wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Basics Quiz (2nd year_1st_term)

Total questions: 12

Worksheet time: 9mins

Name
Class
Date
1.

How to take inputs from the user?

a)

input( )

b)

print( )

c)

enter( )

d)

write( )

2.

How to store 5 in a variable called x?

a)

x -> 5

b)

x = 5

c)

x == 5

d)

5 = x

3.

what symbols can be used in the variable names?
(you can choose more than one answer)

a)

an undescore (_)

b)

minus sign ( - )

c)

a space ( )

d)

a slash (/)

4.

How to define to define two variables containing numbers in their names?

a)

x1 = 5
x2 = 6

b)

1x = 5
2x = 6

c)

1_x = 5
2_x = 6

d)

x_1 = 5
x_2 = 6

5.

Imagine that you are working on a large code and used input() to take data from the user but you don't know the type of the value stored in a certain variable. How can you know the type?

a)

kind( )

b)

type( )

c)

like( )

d)

Type( )

6.

what is the result of this code?

a)

0

b)

-50

c)

100

d)

error

7.

what does / do in mathematical equations?

a)

calculate the whole result

b)

calculate the remainder

c)

calculate the integer value of the division

d)

error

8.

what does % do in mathematical equations?

a)

calculate the whole result

b)

calculate the remainder

c)

error

d)

calculate the integer value of the division

9.

how to use ** to take the square root of 9?
(you can choose more than one answer)

a)

9**0.5

b)

9**1/2

c)

9**(1/2)

d)

9**(2/4)

10.

What would happen if I used + between two strings?

a)

error

b)

the second string will be added on the right of the first string

c)

the first string will be added on the right of the second string

11.

what is the result of '5' * 4?

a)

'20'

b)

'5555'

c)

'55555'

d)

'44444'

12.

Draw something in three minutes