wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Year 7 Assessment

Total questions: 55

Worksheet time: 29mins

Name
Class
Date
1.

Which of the following would allow the user to enter data?

a)

elif

b)

output

c)

print

d)

input

2.

Which code would display 'Hello World'

a)

Print("Hello World")

b)

print("Hello World")

c)

print(Hello World)

d)

print=("hello world")

3.

If you type 10/5 what result would you get in python?

a)

2

b)

2.0

c)

0

d)

15

4.

If you type 6//2 what result would you get in python.

a)

3.0

b)

4

c)

3

d)

0

5.

What is a variable?

a)

A named memory location

b)

a value

c)

a number

d)

a letter

6.

Which of the following is NOT a suitable variable name?

a)

num1

b)

Num1

c)

MyName

d)

My name

7.

Why do we learn Python?

a)

It's a really big snake

b)

It's the name of a very funny comedy show

c)

It's simple and easy to learn

d)

It's so rare that no one else knows it

8.
What will the output be from the following code?
print("Hello world!")
a)
SyntaxError
b)
Hello world!
c)
"Hello world!"
d)
print(Hello world!)
9.
What will the output be from the following code?
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
10.
print("12"*3)
What would this print?
a)
36
b)
121212
c)
24
d)
12*3
11.
What will the output be from the following code?
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
12.
What will the output be from the following code?
Print("Hello world!")
a)
NameError
b)
Hello world!
c)
"Hello world"
d)
Print(Hello world!)
13.
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
14.
What will the output be from the following code?
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
15.
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!
16.
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
17.
What will the output be from the following code?
print(9/3)
a)
3
b)
3.0
c)
9/3
d)
SyntaxError
18.
A data type consisting of numbers, letters and symbols.
a)
String
b)
Integer
c)
Float
d)
Boolean
19.
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
20.
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
21.
Which function outputs data to the python shell?
a)
print()
b)
int()
c)
input()
d)
def
22.
Which function converts data to an integer
a)
print()
b)
int()
c)
input()
d)
def
23.

What is an Algorithm?

a)

Developing a step by step solution to a problem.

b)

Breaking a complex problem into smaller parts.

c)

Focusing on the important information only.

d)

Looking for similarities within problems.

24.

What program is used to type your code?

a)

Snake

b)

Python

c)

Cobra

d)

Worm

25.

What is this known as 00111000

a)

Denary

b)

Binary

c)

Tertiary

d)

Primary

26.
What is Python?
a)
text based programming language
b)
word processor 
c)
spreadsheet
d)
block based programming language
27.
What will the following code do? 
name = "Bob"
if name == "Bob": 
     print ("Hello " + name) 
else:  
     print ("I dont know you")
a)
prints bob
b)
prints Hello Bob
c)
nothing syntax error
d)
prints I don't know you
28.
What will be the output?
name = 'Dave'
greeting = "Good morning" + name
print (greeting)
a)
Good moning 'Dave'
b)
Good morning Dave
c)
Good morning name
d)
Good morning + Dave
29.
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
30.
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
31.
What symbol is used in python to assign values to a variable?
a)
equals =
b)
plus + 
c)
forward slash /
d)
asterisk *
32.
What will be the output?
name = 'Dave'
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
33.
What is computational thinking?
a)
It allows you to break down a large / complex problem into smaller parts.
b)
It is thinking like a robot
c)
It is being able to bake a cake.
d)
It is creating a coding solution to a problem.
34.
Why do we need to think computationally?
a)
To help us program
b)
To help us solve complex problems more easily
c)
To help us to think like a computer
35.
a)
red, green
b)
red, red
c)
green, red
d)
green, green
36.
What is the rule for this pattern?
32,36,40,44
a)
add 4
b)
multiply 2
c)
subtract 4
d)
divide by 2
37.
Why do we use flowcharts?
a)
To represent algorithms in an easy way
b)
To use different maths shapes
38.
What is a flowchart?
a)
A visual representation of an algorithm using symbols
b)
Using 'fake code' to plan an algorithm
c)
Using a programming language to show an algorithm
d)
Uisng different types of charts to show an algorithm
39.

Code is...

a)

when it's not warm.

b)

the dog from Garfield.

c)

a song or poem dedicated to someone.

d)

specific instructions in a computer program.

40.

What do we call the person who writes the instructions for the computer to complete a task?

a)

architect

b)

coder

c)

Bob

d)

composer

41.
What is the action of doing something over and over again?
a)
Loop
b)
Persistence
c)
Program
d)
Code
42.

A good code/program must be

a)

Detailed and short

b)

Hard to understand

c)

Very long

43.

Which of these is suitable for a variable name

a)

x = '4hello'

b)

x = 'hello there'

c)

x = 'hello'

d)

x = hello there

44.

which of the statements below will print properly?

x = 6

y = "I am"

a)

print (y , x)

b)

print ((int(y) , x)

c)

print (y, (str(x))

d)

print (y , (int(x))

45.

Which line in this program is incorrect?


if 6 > 8:

print ("Correct")

else

print ("Incorrect")

a)

Line 1

b)

Line 2

c)

Line 3

d)

Line 4

46.

Which line in this program is incorrect?


if 9 > 8:

Print ("Correct")

else:

print ("Incorrect")

a)

Line 1

b)

Line 2

c)

Line 3

d)

Line 4

47.

What is the keyword needed to repeat code (iterate) in Python?

a)

for

b)

if

c)

input

d)

print

48.
What does turn(90) do?
a)
Turns right 90 degrees
b)
Turns left 90 degrees
c)
Moves forward 90
d)
Does nothing as 'turn' is not a turtle instruction
49.

In order to move the turtle 120 forward without drawing on the screen, which order is correct?

a)

forward(120)

penup()

pendown()

b)

pendown()

forward(120)

penup()

c)

penup()

forward(120)

pendown()

50.

Look at this code, how many times will it loop?

a)

50

b)

90

c)

0

d)

4

51.

Look at this code, which of these is a variable?

a)

input

b)

4

c)

int

d)

mylength

52.

What is wrong with this code?

a)

Missing Brackets

b)

Missing Comma

c)

Missing Colon

d)

Incorrect spelling

53.

What is wrong with this code?

a)

Missing Brackets

b)

Missing Comma

c)

Missing Colon

d)

Incorrect spelling

54.
What will be the output from this code?
a)
A star with an orange outline
b)
A solid orange star
c)
A pentagon with an orange outline
d)
A solid orange pentagon
55.
This code should draw a solid orange square but it is not correct. How many errors are there?
a)
1
b)
2
c)
3
d)
4