wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Advance Python

Total questions: 10

Worksheet time: 2mins

Name
Class
Date
1.

What is the maximum length of a Python identifier?

a)

32

b)

16

c)

128

d)

No fixed length is specified

2.

What will be the output of the following code snippet?

print(2**3 + (5 + 6)**(1 + 1))

a)

129

b)

8

c)

121

d)

None of the above

3.

What will be the datatype of the var in the below code snippet?

var = 10

print(type(var))

var = "Hello"

print(type(var))

a)

str and int

b)

int and int

c)

str and str

d)

int and str

4.

How is a code block indicated in Python?

a)

Brackets

b)

Indentation

c)

Key

d)

None of the above

5.

What will be the output of the following code snippet?

print(type(5 / 2))

print(type(5 // 2))

a)

float and int

b)

int and float

c)

float and float

d)

int and int

6.

Which of the following concepts is not a part of Python?

a)

Pointers

b)

Loops

c)

Dynamic Typing

d)

All of the above

7.

Which of the following statements are used in Exception Handling in Python?

a)

Try

b)

Except

c)

Finally

d)

All of the above

8.

Which of the following types of loops are not supported in Python?

a)

For

b)

While

c)

Do-While

d)

None of the above

9.

Which of the following is the proper syntax to check if a particular element is present in a list?

a)

If ele in list

b)

If not ele not in list

c)

Both A and B

d)

None of the above

10.

Which of the following functions converts date to corresponding time in Python?

a)

strptime ( )

b)

strftime ( )

c)

Both A and B

d)

None of the above