wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python - Quiz 2

Total questions: 20

Worksheet time: 9mins

Name
Class
Date
1.

Choose the immutable data types

a)

Dictionary

b)

Tuple

c)

List

d)

String

2.

Which of the following operator is used for checking the equality ?

a)

=

b)

= =

c)

both = and = =

d)

equal to

3.

Which of the following is a mutable data type ?

a)

Dictionary

b)

List

c)

String

d)

int

4.

Name the function for finding the memory location of a variable.

(a)  

5.

Name the function used for finding the data type of a variable.

(a)  

6.

Which of the following comments are valid ?

a)

"""have a

nice day"""

b)

'have a nice day'

c)

"have a nice day"

d)

#have a nice day

7.

15%3

(a)  

8.

17//5

(a)  

9.

Choose the operator that calculates the quotient

a)

&

b)

**

c)

%

d)

/

10.

Which operator has the highest precedence ?

a)

%

b)

//

c)

/

d)

**

11.

False and True

a)

True

b)

False

12.

Which of the following is a logical operator?

a)

not

b)

And

c)

or

d)

Or

13.

a/=b is same as ?

a)

b=a/b

b)

a=b/a

c)

a=a/b

d)

b=b/a

14.

Name the type of operator >=

a)

Logical

b)

Relational

c)

Assignment

d)

Arithmetic

15.

Name the type of operator /=

a)

Logical

b)

Relational

c)

Assignment

d)

Arithmetic

16.

Name the type of operator =

a)

Logical

b)

Relational

c)

Assignment

d)

Arithmetic

17.

This type of error gives an undesirable output

a)

Logical Error

b)

Runtime Error

c)

Syntax Error

18.

_______ error occurs when the rules of the programming language is violated.

a)

Runtime

b)

Syntax

c)

Logical

19.

Which of the following gives a syntax error in Python?

a)

100=a

b)

a=102

c)

print 7+3

d)

Print 7

20.

This type of conversion is done automatically without the programmer's intervention.

a)

Explicit Type Conversion

b)

Coercion

c)

Type Casting

d)

Implicit Type Conversion