wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Quiz 1.4

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

What is the maximum possible length of an identifier?

a)

16

b)

32

c)

64

d)

None of These

2.

Write the output of the given code

a=[10, 20]

b = a

b+= [30, 40]

print(a)

a)

[10,20,30,40]

b)

[10,20,[10,20,30,40]]

c)

[10,20,30,40,[10,20]]

d)

None of above

3.

Which of the following statements is correct regarding the object-oriented programming concept in Python?

a)

Classes are real-world entities while objects are not real

b)

Objects are real-world entities while classes are not real

c)

Both objects and classes are real-world entities

d)

All of the above

4.

What is the method inside the class in python language?

a)

Object

b)

Function

c)

Attribute

d)

Argument

5.

Which of the following is not a keyword in Python language?

a)

val

b)

raise

c)

try

d)

with

6.

Which of the following words cannot be a variable in python language?

a)

_val

b)

val

c)

try

d)

_try_

7.

Which of the following operators is the correct option for power(ab)?

a)

a^b

b)

a**b

c)

a^^b

d)

a^*b

8.

Study the following function:

round(4.576)

What will be the output of this function?

a)

4

b)

5

c)

576

d)

5.0

9.

Study the following function:

all([2,4,0,6])

What will be the output of this function?

a)

False

b)

True

c)

0

d)

Invalid code

10.

import math

abs(math.sqrt(36))

What will be the output of this code?

a)

Error

b)

-6

c)

6

d)

6.0

11.

a="technoindia"

print(a[5:-2])

What will be the output of this code?

a)

oindi

b)

oind

c)

noind

d)

noindi

12.

What will be the output of this statement?

list1 = ['t', 'e', 'c', 'h', 'n', 'o']

print("-".join(list1))

a)

t e c h n o

b)

t-e-c-h-n-o

c)

t e c h

d)

[t-e-c-h-n-o]