wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python - Basics

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the output of the following code?

a)

Salary: 12000 Salary: 8000

b)

Salary: 8000 Salary: 12000

c)

The program failed with errors

2.

What is the output of the following code?

a)

20

b)

Error

c)

30

3.

What is the output of the following code?

a)

10

15

b)

25

125

c)

Error

4.

A string is immutable in Python?

a)

True

b)

False

5.

What is the output of the following code?

a)

JamesJamesJamesJamesJamesJames

b)

JamesJamesJamesJamesJames

c)

Error

6.

What is the output of the following?

a)

182

b)

37

c)

117

d)

Error

7.

What is the output of the following code?

a)

6

b)

33

c)

123

d)

Error

8.

What is the output of the following loop?

a)

J, h, n,

b)

J, h, o, n,

9.

What is the value of x?

a)

101

b)

99

c)

None of the above

d)

100

10.

What is the type of the following variable?


x = -5j

a)

int

b)

complex

c)

string

d)

real