wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Module 1

Total questions: 13

Worksheet time: 3mins

Name
Class
Date
1.

How do you create a variable with the numeric value 5?

a)

x = 5

b)

Both the answers are correct

c)

x = int(5)

d)

None

2.

Is python compiled language ?

a)

Yes

b)

No

c)

No Idea

3.

What will be the output of :

a = 4.5

b = 2

print( a//b )

a)

2.0

b)

2.5

c)

2.25

d)

Error

4.

What will be the output of above program

a)

OLDDY

b)

NEWDY

c)

Error

d)

None

5.

What will be the output of above program

a)

40

b)

42

c)

38

d)

36

6.

Which of the following are true of Python dictionaries:

a)

Dictionaries are accessed by key.

b)

Dictionaries can be nested to any depth.

c)

All the keys in a dictionary must be of the same type.

d)

A dictionary can contain any object type except another dictionary.

7.

What command is used to insert 6 in a list "L" at 3rd position?

a)

L.insert(3,6)

b)

L.add(3,6)

c)

L.insert(2,6)

d)

L.append(2,6)

8.

list = 5*[0]+5*[10]

What is the output of this?

a)

Error

b)

[0,0,0,0,0,10,10,10,10,10]

c)

[50]

d)

[5,50]

9.

What is the output of the following program :

print "Hello World"[::-1]

a)

dlroW olleH

b)

Hello Worl

c)

d

d)

Error

10.

What is the output of the following program :

print(0.1 + 0.2 == 0.3)

a)

True

b)

False

c)

Machine Dependent

d)

Error

11.

Which of the following is false statement in python

a)

int(144)==144

b)

int('144')==144

c)

int(144.0)==144

d)

None of the above

12.

What is output for −


' ' in 'python' ?

a)

'python'

b)

False

c)

' '

d)

True

13.
a)

Indentation Error

b)

Cannot perform mathematical operation on strings

c)

hello2

d)

hello2hello2