wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PythonFun

Total questions: 8

Worksheet time: 4mins

Name
Class
Date
1.

Every time when we modify the string, Python Always create a new String and assign a new string to that variable.

a)

True

b)

False

2.

Guess the output


a = 5

def func():

____a = 20

____print(a)

print(a)

a)

5

b)

20

c)

None of the above

d)

Error

3.

Guess the output:


a = 5

def func():

____a = 20

____print(a)

print(a)

func()

a)

5

20

b)

20

5

c)

20

20

d)

5

5

4.

Guess the output:


a = 5

def func():

____global a

____a = 20

____print(a)

print(a)

a)

20

b)

5

c)

20

20

d)

Error

5.

Guess the output:


a = 5

def func():

____global a

____a = 20

____print(a)

print(a)

func()

a)

5

20

b)

20

5

c)

20

20

d)

5

5

6.

Guess the output:


a = 5

def func():

____global a

____a = 20

____print(a)

func()

print(a)

a)

20

5

b)

5

20

c)

20

20

d)

5

5

7.

Guess the output:


print("Hey", "There" "i" "am" "Rahul")

a)

Hey There i am Rahul

b)

Hey ThereaamRahul

c)

HeyThereaamRahul

d)

Error

8.

guess the output:


i = 2345

length = 0

for a in i:

____length += 1


print(length)

a)

4

b)

2345

c)

Error