wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Revision

Total questions: 15

Worksheet time: 9mins

Name
Class
Date
1.
What is the name of the environment in Python that write your programs and then test them out?
a)
Shell
b)
Window
c)
IDLE
d)
CLI
2.
What extension must you add to the end of a file when saving?
a)
.xlsx
b)
.pptx
c)
.docx
d)
.py
3.
What button do you press to compile (run) your program so that it runs in the shell?
a)
F3
b)
F5
c)
F7
d)
F9
4.
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.
5.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
6.
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!
7.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
8.
What is a variable?
a)
A box(memory location) where you store values
b)
a type of graphics
c)
Data type
d)
a type of memory
9.
What will be the output?
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
10.
A data type consisting of numbers, letters and symbols.
a)
String
b)
Integer
c)
Float
d)
Boolean
11.
Data type for a whole number
a)
String
b)
Integer
c)
Boolean
d)
Float
12.
Which of these is the correct way to print a string?
a)
print="Hello World"
b)
Print=("Hello World")
c)
print=("Hello World")
d)
print(Hello World)
13.
What will the output be from the following code?
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
14.

What is the Python code needed to ask a user for input?

a)

input("what is your name?")

b)

input="what is your name?"

c)

(input)=what is your name?

d)

input=what is your name?

15.

Choose the TWO correct data types from the list below

a)

Integer

b)

Real

c)

Fake

d)

Short