wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Knowledge Check

Total questions: 55

Worksheet time: 41mins

Name
Class
Date
1.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
2.
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
3.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
4.
What is the name of the programming language we are learning?
a)
Scratch
b)
Python
c)
Pie thin
d)
Scribble
5.

What will be the output?

name = "Dave"

print (name)

a)

Dave

b)

'Dave'

c)

name

d)

(name)

6.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
7.
What is Python?
a)
text based programming language
b)
word processor 
c)
spreadsheet
d)
block based programming language
8.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
9.
Which statement correctly assigns the string "Tanner" to the variable name?
a)
name  = print( "Tanner")
b)
input("Tanner")
c)
name = "Tanner"
d)
name = input("Tanner")
10.

What is a folder?

a)

the name given to a set of recorded information

b)

the name given to the place where files that can be bought

c)

the name given to the place where files that can be stolen

d)

the name given to the place where files that can be stored

11.
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.
12.
What syntax can you use to insert a line break between strings so that they appear over multiple lines?
a)
/
b)
\n
c)
\l
d)
n
13.
What will the output be from the following code?
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
14.
What is the correct definition for a VARIABLE?
a)
a changeable value, such as a score in a computer game.
b)
a value that cannot be changed
15.

A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly.

a)

True

b)

False

16.

Python language was developed in what year?

a)

1985

b)

2001

c)

1991

d)

1820

17.

Python uses indentation to block code into chunks

a)

True

b)

False

18.

What datatype will the answer be if the user enters 15 and 30?

a)

Integer

b)

String

c)

Boolean

d)

Float

19.

Which one will display when this code is run?

a)
b)
c)
d)
20.
What symbol do you use to make a comment in Python?
a)
@
b)
¬
c)
;
d)
#
21.

What will this code do?

a)

Print Numbers 1-11

b)

Print Numbers 1-10

c)

Print Numbers 2-10

d)

Print Error

22.

Which of these is NOT a loop in python?

a)

for loop

b)

while loop

c)

nested loop

d)

if loop

23.

Which of these operators means EQUAL TO?

a)

'='

b)

'=>'

c)

'<='

d)

'=='

24.

What does the '#' allow you to do?

a)

Repeat code

b)

Comment on code

c)

Print code

d)

End code

25.

If i want to continuously check for a correct answer, what loop would i use?

a)

for loop

b)

while loop

26.
In python the ' FLOAT data type' can be defined as...?
a)
holds alphanumerical data
b)

holds whole numbers

c)

holds a decimal point in a number

d)
hold either true or false
27.
In python the ' INTEGER data type' can be defined as...?
a)
holds alphanumeric data as text
b)
holds whole numbers
c)
holds numbers with a decimal point
d)
holds either ‘true’ or ‘false’
28.
In python the ' STRING data type' can be defined as...?
a)
holds alphanumeric text
b)
hold whole numbers
c)
holds numbers with a decimal point
d)
holds either a true or false value
29.
What is the correct definition for a VARIABLE?
a)
a changeable value, such as a score in a computer game.
b)
a value that cannot be changed
30.
What data type would be used for storing someone's telephone numbers?
a)
Float (using a decimal point)
b)
Integer (just whole numbers)
c)
String (alphanumerical data)
31.
If we needed to store information such as a POSTCODE in PYTHON, what data type would we use?
a)
String (alphanumerical)
b)
Float (decimal point)
c)
Boolean (true or false)
32.
what is the code for a STRING in python?
a)
str
b)
stri
c)
stg
33.
what is correct code for INTEGER in python?
a)
in
b)
ing
c)
int
34.
What is the output from the following code?print ("hello world")
a)
Hello World
b)
hello world
c)
print hello world
35.
What best defines an IF statement in python?
a)
Is an embedded string with a variable
b)
An IF statement checks to see if a statement is true or false and then does one of two things depending on the result.
36.
The number or word we give to a variable
a)
Value
b)
Bug
c)
Information
d)
Text
37.

What is the Python built-in function used to display numbers and text on the screen?

a)

print

b)

input

c)

output

d)

command

38.

If you want to create an empty list called colours in Python, which of the following is correct?

a)

colours = [ ]

b)

colours = ( )

c)

colours = { }

d)

colours = <>

39.
What is the position of the name "Robert" in the following list:
a)
0
b)
1
c)
2
d)
3
40.
In the following code, "city" is an example of a what?
a)
List
b)
Loop
c)
Variable
d)
Array
41.
In the following code, "city" is an example of a what?
a)
List
b)
Loop
c)
Variable
d)
Array
42.

Each item in a list has an index. What is the first index in a Python list?

a)

0

b)

1

c)

a

d)

A

43.
What output will this code produce?
a)
3
b)
20
c)
25
d)
17
44.
What output will this code produce?
a)
1
b)
3
c)
2
d)
4
45.

What will the output be from the following code?

print(3+4)

a)

3+4

b)

7

c)

SyntaxError

d)

print(3+4)

46.

What will the output be from the following Python code?

Print("Hello world!")

a)

NameError

b)

Hello world!

c)

"Hello world"

d)

Print(Hello world!)

47.

What will the output be from the following Python code?

print(9/3)

a)

3

b)

3.0

c)

9/3

d)

SyntaxError

48.

What will the output be from the following Python code?

print(Hello world!)

a)

Hello world!

b)

SyntaxError

c)

Hello world

d)

print(Hello world!)

49.
A location in memory used to store data that can be changed.
a)
Constant
b)
Value
c)
Variable
d)
Iteration
50.
The correct way to write a variable in Python?
a)
my_variable = 10
b)
my variable = 10
c)
my_variable is 10
d)
my_variable: 10
51.

Which of these is correct Python conditional statement?

a)

IF answer == "Yes":

b)

if answer == "Yes"

c)

if answer == "Yes":

d)

if answer = "yes":

52.

Which of these is correct Python conditional statement?

a)

IF answer == "Yes":

b)

if answer == "Yes"

c)

if answer == "Yes":

d)

if answer = "yes":

53.
What is python named after
a)
The snake
b)
Television show called Monty Python
54.
What does the term 'debug' mean?
a)
Identify errors and fix them.
b)
Making a calculation
c)
A set of instructions
d)
Looking at code
55.
What will the output be from the following code?
print("Hello world!" * 2)
a)
TypeError
b)
Hello world world!
c)
Hello world!Hello world!
d)
Hello world! * 2