wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.
What is a variable?
a)

A memory location where you store values

b)
a type of graphics
c)
Data type
d)
a type of memory
2.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
3.
What does the print function do in python?
a)
It's a variable.
b)
It can input data.
c)

It displays an output

d)
It loops the code.
4.
In the following code, "city" is an example of a what?
a)
List
b)
Loop
c)
Variable
d)
Array
5.

What is the output from the following code?

print ("hello world")

a)
Hello World
b)
hello world
c)
print hello world
6.

What is the Python command used to display numbers and text on the screen?

a)

print

b)

input

c)

output

d)

command

7.

What would print (10 + 16) produce?

a)

10

b)

16

c)

24

d)

26

8.

An  algorithm  is a set of precise instructions designed to solve a problem.

a)

True

b)

False

9.

What would be the result of 3 ** 3

(a)  

10.

What would be the result of 9 // 7

(a)  

11.

What would be the reult of 9 % 7

(a)  

12.

Which is NOT a data type in Python?

a)

integer

b)

boolean

c)

anchor

d)

float

13.

_______ is a data type that contain a set of characters (letters, symbols, etc.) E.g. "Hello", "Ali", "Car Type"

a)

int

b)

float

c)

char

d)

String

14.

Which value is of data type String?

a)

64

b)

"Cat"

c)

True

d)

0.5

15.

What is a Float?

a)

A data type that contains whole numbers as: 3, 45, 124

b)

Numbers with decimal point as: 0.5, 2.45, 56.04

c)

Group of characters between quotation marks as : "Maryam"

d)

Data type that can only be True or False.

16.

Which value is of data type Float?

a)

64

b)

"Cat"

c)

True

d)

0.5

17.

Which value is of data type Integer?

a)

64

b)

"Cat"

c)

True

d)

0.5

18.

Which value is a Boolean?

a)

64

b)

"cat"

c)

True

d)

0.5

19.

What is IDE?

a)

Integrated Development Environment

b)

Implicit Deployment Environment

c)

Interrogated Development Environment

20.
Which data type is used to store:
100
a)
Integer
b)
Double
c)
Boolean
d)
String
21.

What type of data is this?

num = 3

a)

String

b)

Integer

c)

Float

22.

What would the output be?

x = "4+3"

print(x)

a)

7

b)

7.0

c)

4+3

23.

Which is the operator used to MULTIPLY?

a)

+

b)

*

c)

/

d)

-

e)

%

24.

Which is the operator used to DIVIDE?

a)

+

b)

*

c)

/

d)

-

25.

What would the output of this code be?

x = ("Bill")

print(x)

a)

x

b)

"Bill"

c)

Bill

d)

Frank

26.

If we typed this code into Python: print(6 + 3 * 7),what output would we see on screen?

a)

63

b)

637

c)

16

d)

27

27.
a)

0

b)

2

c)

4 % 2

d)

2.0

e)

Error

28.
a)

The result is 16

b)

The result is 8

c)

The result is 4 ** 2

d)

The result is 4**2

e)

Error

29.
a)

2

b)

0

c)

1

d)

4 / 2

e)

Error

30.

Which value is a String?

a)

64

b)

"cat"

c)

True

d)

0.5