wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python operator and collections

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

What is the value of the expression 100 / 25?

a)

4

b)

4.0

c)

"4.0"

d)

'4.0'

2.

Which is the correct operator for power(x^y)?

a)

X^y

b)

X**y

c)

X^^y

d)

None of the mentioned

3.

Which one of these is floor division?

a)

/

b)

//

c)

%

d)

None of the mentioned

4.

What is the answer of this expression, 22 % 3 is?

a)

7

b)

1

c)

0

d)

5

5.

print(not (0<1))

a)

TRUE

b)

FALSE

c)

TYPE ERROR

6.

print(5+8*2)

a)

26

b)

21

c)

169

7.

The code above prints

a)

Math

Physics

Chemistry

English

b)

4

3.8

3.6

3.7

c)

None

None

None

None

d)

NaN

NaN

NaN

NaN

8.

________________method will returns number of key-value pairs in the given dictionary.

a)

len( )

b)

pop( )

c)

del( )

d)

keys( )

e)

values( )

9.

____________ is a collection which is unordered, changable and indexed.

a)

Dictionary

b)

List

c)

Tuple

d)

Set

10.

List = [2.3, 4.445, 3, 5.33, 1.054, 2.5]

print(List.pop()) What willbe the answer?

a)

2.3

b)

2.5

c)

1.054

d)

4.445

11.

a=(1,2,3,2,4,5,2)

a.count(2)

What will be the answer?

a)

2

b)

1

c)

3

d)

4

12.

List = [1, 2, 3, 1, 2, 1, 2, 3, 2, 1]

print(List.count(1))

What will be the output?

a)

1

b)

2

c)

3

d)

4