wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

PYTHON QUIZ - DAY 2

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Which of the following is the correct definition of a variable in Python?

a)

A variable is a reserved memory location to store values.

b)

A variable is a fixed value that cannot change. 

c)

A variable is a type of function in Python.

d)

A variable is used to perform arithmetic operations.

2.

What is the value of x after executing x = 5 and then x = 10?

a)

5

b)

10

c)

15

d)

0

3.

Which of the following variable names is not valid in Python?

a)

my_var 

b)

_myvar 

c)

2myvar

d)

myVar2

4.

How do you write a single-line comment in Python?

a)

/* This is a comment */ 

b)

# This is a comment 

c)

<!-- This is a comment --> 

d)

// This is a comment 

5.

Which of the following is a correct way to write a multi-line comment in Python?

a)

/* This is a multi-line comment */ 

b)

'''This is a multi-line comment '''

c)

<!-- This is a multi-line comment --> 

d)

# This is a multi-line comment

6.

What is a token in Python?

a)

A token is a special type of function. 

b)

A token is the smallest unit in a program. 

c)

A token is a part of a loop. 

d)

A token is a type of variable. 

7.

Which of the following is not a type of token in Python?

a)

Keyword

b)

Identifier

c)

Operator 

d)

Array 

8.

How many keywords are there in Python 3.8?

a)

33

b)

35

c)

37

d)

39

9.

Which of the following is not a keyword in Python?

a)

define

b)
None
c)
True
d)
False
10.

Which of the following is not an arithmetic operator in Python?

a)

+

b)

-

c)

*

d)

==

11.

Which of the following operators is used for floor division in Python?

a)
%
b)
//
c)

**

d)

/

12.

What will be the result of 5 % 2 in Python?

a)
2
b)
1
c)

0

d)
3
13.

Which of the following is a logical operator in Python?

a)

=

b)
and
c)

%

d)

*

14.

Which of the following operators is used to compare two values in Python?

a)

==

b)

=

c)

><

d)

!=

15.

Which of the following is a bitwise operator in Python?

a)

not

b)

&

c)

and

d)
+