wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python3

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What will be the result of the code below

x, y, z = "Orange", "Banana", "Cherry"

print(x)

a)

"Orange", "Banana", "Cherry"

b)

"Banana", 

c)

"Banana", "Cherry"

d)

"Orange"

2.

x = y = z = "Mango"

print(x)

a)

print(x)

b)

"Mango"

c)

banana

d)

orange

3.

What is the result of the code below?

fruits = ["apple", "banana", "cherry"]

x, y, z = fruits

print(z)

a)

"apple"

b)

 "cherry"

c)

banana

d)

None

4.

The Python print statement is often used to output variables.

a)

True

b)

False

c)

None

5.

Run the code below

x = "awesome"

print("Python is " + x)

a)

"Python awesome is "

b)

"awesome is "

"Python

c)

Python is awesome

d)

None

6.

x = "Python is "

y = "awesome"

z = x + y

What code will you write to bring out the result of z

a)

print(z)

b)

print(x)

c)

print(y)

d)

print(yz)

7.

x = "awesome"

def myfunc():   

print("Python is " + x)

myfunc()

a)

"Python is

b)

"Python is awesome"

c)

"Python is banana"

d)

"Python is apple"

8.

When you create a variable inside a function, that variable is local, and can only be used inside that function.

a)

True

b)

False

c)

None

d)

All

9.

What type of variable is this?

myVariableName = "John"

a)

Pascal Case

b)

Camel Case

c)

Snake Case

d)

All

10.

Is this variable name acceptable?

2myvar = "John"

a)

Yes

b)

No

c)

I dont know