Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Input, Output, Variables and Operators

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Which of these stores a piece of data, and gives it a specific name?

a)

variable

b)

whitespace

c)

interpreter

d)

modulo

2.

Which data type than can have one of two values: True or False?

a)

boolean

b)

variable

c)

modulo

d)

interpreter

3.

Which example is the correct way to write a variable in Python and and assign it a value?

a)

my_variable = 10

b)

my variable = 10

c)

my_variable is 10

d)

my_variable: 10

4.

Which data type can store numbers, letters and symbols?

a)

String

b)

Integer

c)

Float

d)

Boolean

5.

Which data type is the most suitable to store a whole number?

a)

String

b)

Integer

c)

Boolean

d)

Float

6.
What does the print function do in python?
a)
It's a variable.
b)
It can input data.
c)
It displays something like a string or integer
d)
It loops the code.
7.
What will the output be from the following code?
print("Hello world!")
a)
SyntaxError
b)
Hello world!
c)
"Hello world!"
d)
print(Hello world!)
8.
What will the output be from the following code?
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
9.

print("12"*3)

What would this print?

a)

36

b)

121212

c)

24

d)

12*3

10.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
11.
What will the output be from the following code?
print("Hello" + "world" + "today")
a)
Helloworldtoday
b)
Hello world today
c)
"Hello" "world" "today"
d)
SyntaxError
12.
What will the output be from the following code?
print("Hello world!\nHello world!")
a)
Hello world! Hello world!
b)
Hello world!
Hello world!
c)
SyntaxError
d)
Hello world!
13.
Which function takes a users input
a)
print()
b)
int()
c)
input()
d)
def
14.
Which is the most appropriate data type for: "13th December"
a)
Float
b)
Boolean
c)
Integer
d)
String
15.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
16.

What symbol is used in python to assign values to a variable?

a)

equals =

b)

plus +

c)

two equal signs ==

d)

asterisk *

17.
What will be the output?
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
18.
What would print (10 + 16) produce?
a)
20
b)
22
c)
24
d)
26
19.
What is the answer to print (12/6)?
a)
1
b)
2
c)
6
d)
10
20.
How do you display text?
a)
input
b)
output
c)
print
d)
variable