wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python + Turing Lab + Code Combat + Computaional Thinking

Total questions: 100

Worksheet time: 3hrs 19mins

Name
Class
Date
1.

What is a command?

a)

"An instruction put in between quote marks"

b)

An instruction that tells the computer to perform a certain action.

c)

An instruction put in CAPITAL LETTERS

d)

An instruction that is repeated at least once

2.

What is a computer program?

a)

A computer that has learned to program

b)

A text document written by a computer

c)

A television program on a computer

d)

A set of instructions that tell the computer what to do

3.

What is the name of the programming language we are learning?

a)

Scratch

b)

Python

c)

Turinglab

d)

C#

4.

Which two of these are function calls?

a)

prepare_soil

b)

move_forward()

c)

"tomato"

d)

prepare_soil()

5.

What is a function?

a)

A function is a command that performs a specific action when called

b)

Functions are words that always have brackets after them

c)

Functions are commands that have quotes around them and can be put between brackets

d)

Functions are commands that allow you to convert your code from one language to another

6.

Which function call moves the Farmbot forward?

a)

move_forward()

b)

move_forward

c)

Move_Forward()

d)

moveForward()

7.

Which two of the following are strings?

a)

tomato

b)

'A very large pumpkin'

c)

pumpkins and aubergines

d)

"tomato"

8.

What is an algorithm?

a)

A set of instructions that are to be repeated more than once

b)

A set of commands used to perform a particular task

c)

Any computer program

d)

A command created by Mr. Algo Rhythm

9.

Which of these is a function call?

a)

plant

b)

plant("tomato")

c)

move_forward()

d)

"tomato"

10.

Select the two function calls

a)

move_forward

b)

move_forward()

c)

turn("left")

d)

"left"

11.

Identify which lines of code the strings appear on

a)

2, 3

b)

1, 2

c)

2, 4

d)

1, 3

12.

Select the code that will prepare soil and then plant a tomato

a)
b)
c)
d)
13.

Which of these is an argument in the code shown?

a)

plant()

b)

move_forward()

c)

"tomato"

d)

plant("tomato")

14.

Where is Farmbot going to be after running the code?

a)
b)
c)
d)
15.

Identify the two functions written in snake case

a)

returnHome()

b)

prepare_soil()

c)

turn("right")

d)

move_forward()

16.

Identify the bug in the code shown

a)

Indentation error - caused by incorrect spelling

b)

Name Error - caused by incorrect spelling

c)

Syntax Error - caused by incorrect brackets

d)

Symtax Error - caused by incorrect quote marks

17.

Identify the bug in the code shown

a)

Indentation error - caused by incorrect spelling

b)

Name Error - caused by incorrect spelling

c)

Syntax Error - caused by incorrect brackets

d)

Symtax Error - caused by incorrect quote marks

18.

Identify the bug in the code shown

a)

Indentation error - caused by incorrect spelling

b)

Name Error - caused by incorrect spelling

c)

Syntax Error - caused by incorrect brackets

d)

Symtax Error - caused by incorrect quote marks

19.

Select the two ways of adding a comments in Python

a)

// Move into position

b)

## Harvest a row

c)

/* Plant a row */

d)

# Move into position

20.

Which two students have commented their code effectively?

a)
b)
c)
d)
21.

Which two of these functions have been written using snake case?

a)

plant()

b)

turn()

c)

prepare_soil()

d)

move_forward()

22.

Which of the following is NOT a common error message when writing Python code?

a)

Name Error

b)

Syntax Error

c)

Indentation Error

d)

Spelling Error

23.

What is debugging?

a)

The process of finding bugs in your code

b)

The process of writing bugs into your code

c)

A mistake in your code

d)

The process of finding and removing bugs from your code

24.

Which of the following is the correct way of writing a FOR loop?

a)
b)
c)
d)
25.

Which three of the following describe the benefits of using a FOR loop in your code?

a)

It helps create more readable and maintainable code

b)

It stores useful information for later retrieval

c)

It helps select which path to take in the code

d)

It helps by reducing repetition in a programmers code

e)

It helps create clear and concise code

26.

What kind of programming language is Python?

a)

Block

b)

Text

c)

Picture

d)

Function

27.

Which command is correct?

a)

move_forward()

b)

Move_Forward()

c)

move_forward

d)

move_forward("")

28.

Which command is correct?

a)

returnHome()

b)

return_Home()

c)

return_home()

d)

RETURN_HOME()

29.

Which line of code is the error on?

a)

1

b)

2

c)

3

d)

4

30.

What line of code is missing from here to make farmbot plant two potatoes?

(a)  

31.

Every game & app has been created using a programming language:

a)

True

b)

False

32.

Is the following code snake case or camel case?


returnHome()

a)

Snake case.

b)

Camel case.

c)

Neither.

33.

Is the following code snake case or camel case?


return_home()

a)

Snake case.

b)

Camel case.

c)

Neither.

34.
When you have an error in your code what is the term to summarise finding and fixing that error?
a)
Error checking
b)
Debugging
c)
Syntax finder
d)
Error finder
35.

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

a)

True

b)

False

36.
What is the word (command) used to display numbers and text on the screen?
a)
print
b)
input
c)
output
d)
command
37.

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

a)

equals =

b)

plus +

c)

forward slash /

d)

asterisk *

38.
Comments help the programmer make ________ within the program without affecting the code.
a)
notes
b)
changes
c)
revisions
d)
a mess
39.
Code executed based on a condition being true
a)
Sequence
b)
Selection
c)
Iteration
d)
Variable
40.
Code repeated / looped until a condition has been met or a set number of times.
a)
Sequence
b)
Selection
c)
Iteration
d)
Variable
41.

The statement using the and operator results true if _______

a)

both operands are true

b)

both operands are false

c)

either of the operands is true

d)

first operand is true

42.

Which of these is correct Python conditional statement?

a)

IF answer == "Yes":

b)

if answer == "Yes"

c)

if answer == "Yes":

d)

if answer = "yes":

43.

What is a String?

a)

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

b)

Numbers with decimal point. eg: 0.5, 2.45, 56.04

c)

Group of characters between quotation marks. eg: "dog"

d)

Data type that can only be True or False.

44.

Which of these operators means EQUAL TO?

a)

'='

b)

'=>'

c)

'<='

d)

'=='

45.

Will the lights be on or off at 10 o’clock?

Select one of the following

a)

Off

b)

On

46.

In the code below, which of the values are variables?

Select one or more of the following

a)

time

b)

print()

c)

get_time()

d)

is_dark

47.

Select a logical operator

a)

if

b)

and

c)

else

d)

>=

48.

What does the colon : symbol tell the computer?

a)

codes that come after it are part of it

b)

codes that are indented under it are part of it

c)

codes that have arguments will be played

d)

codes that are variables will be ignored

49.

What will this code do?

a)

Print Numbers 1-11

b)

Print Numbers 1-10

c)

Print Numbers 2-10

d)

Print Error

50.

When writing an if/else statement, you

a)

always indent the line after the condition

b)

never indent the line after the condition

c)

capitalize every word

d)

put a colon at the beginning and the end

51.

Which of the following is not done by abstraction?

a)

Identifies essential details

b)

Disregards non-essential information

c)

Breaks the problem down into smaller tasks

52.

Which of the following is not done by decomposition?

a)

Allows multiple people to work on the problem together

b)

Disregards non-essential information

c)

Breaks the problem down into smaller tasks

53.

When drawing a dog, which of the following characteristics is non-essential?

a)

Dogs have 4 paws

b)

Dogs have fur

c)

Dogs have brown fur

54.

When designing a building that must be accessible for wheelchairs, which of the following characteristics is non-essential?

a)

Number of doors

b)

Number of walls

c)

Number of wall paintings

55.

One advantage of abstraction is that it means no mistakes can be made

a)

True

b)

False

56.

You could use abstraction to replace specific objects with simple shapes

a)

True

b)

False

57.

This is a good example of decomposition

Sit down

Do homework

a)

True

b)

False

58.

Decomposition allows each task to become _______

a)

More manageable

b)

Easier

c)

Quicker

59.

Decomposition allows the entire task to be completed as _____

a)

A Team

b)

A Whole

c)

Quickly as possible

60.

Abstraction and Decomposition are separate concepts, you would usually choose to do either one or the other

a)

True

b)

False

61.

It is always necessary to decompose a task

a)

True

b)

False

62.

Abstraction and Decomposition are examples of...

a)

Computational Thinking

b)

Algorithmic Thinking

c)

Computer Science

d)

Logical Reasoning

63.

What is pattern recognition?

a)

Breaking down a complex problem into smaller problems

b)

Looking for similarities among and within problems

c)

Building models from patterns

64.

Why do we need to look for patterns in problems?

a)

Patterns make it easier for us to solve complex problems

b)

We don't need to look for patterns

c)

Patterns make it more difficult complex problems

65.

If you don't look for patterns in a problem, your solution might be _____

a)

Wrong

b)

Inefficient

c)

Too slow

66.

Identifying the steps involved in solving a problem

a)

Abstraction

b)

Decomposition

c)

Pattern Recognition

d)

Algorithmic Thinking

67.
Which of the following is an example of thinking computationally?
a)
Planning out your route when going to meet a friend
b)
When going to meet a friend, wandering around until you find them
c)
When going to meet a friend, asking a parent to plan your route for you
68.

Looking for similarities and trends within a problem

a)

Abstraction

b)

Decomposition

c)

Pattern recognition

d)

Algorithmic Thinking

69.

What is a flowchart?

a)

A visual representation of an algorithm.

b)

A diagram that shows abstraction.

c)

A series of shapes.

70.

A school database has lots of information on students, the data manager needs to use abstraction. What data should she leave out?

a)

Age

b)

Guardian's phone numbers

c)

Classes

d)

Eye colour

71.

Which line of code is correct?

a)

hero.MoveLeft()

b)

heroMoveLeft();

c)

hero.moveleft(:

d)

hero.moveLeft()

72.

Which line of code will make the hero move up 4 times?

a)

4.hero.Move.Up();

b)

hero.MoveUp(4);

c)

hero.4MoveUp();

d)

hero.Move4Up();

73.

What must every line of code end with?

a)

comma ,

b)

semi-colon ;

c)

parantheses ()

d)

period .

74.

Which line of code will attack Kratt?

a)

hero.attack("Kratt")

b)

hero.attack("kratt");

c)

hero.attack(Kratt);

d)

Hero.Attack.Kratt;

75.

What is the correct way to write a while loop?

a)

while {

b)

while.true {

c)

while (loop)

d)

while True:

76.

How do you create a variable for enemy1 Gert?

a)

enemy1 = "Gert"

b)

enemy1 = Gert

c)

var.enemy1 = Gert;

d)

var.Enemy.1 = "Gert";

77.

You can enter a number as an argument to instruct your object to move more than one space at a time.

a)

True

b)

False

78.

It is not important to capitalize the name of the variables.

a)

True

b)

False

79.

A string will always have quotation marks.

a)

True

b)

False

80.

What is the main reason we use loops?

a)

It saves time

b)

It is faster to create

c)

It is easier to type

d)

To repeat a block of code without having to retype

81.

Which of the following is a comment? PICK ALL ANSWERS THAT ARE CORRECT!

a)

#Move towards the gem

b)

#Don't touch the spikes!

c)

#Type your code below and click Run when you're done

d)

hero.moveRight()

82.

What is the sprite in this program?

a)

Gem

b)

Spikes

c)

Run

d)

Hero

83.

Which line includes the command?

a)

1

b)

2

c)

3

d)

5

84.

What term describes the rules we use for a language? For example, Python uses dot-notation.

a)

Commands

b)

Functions

c)

Syntax

d)

Variables

85.

What is the argument in this code?

a)

hero

b)

move

c)

Right

d)

3

86.

How many times will this hero move?

a)

5

b)

6

c)

10

d)

Unknown

87.

What is the text string in this program?

a)

hero

b)

moveRight

c)

attack

d)

"Brak"

88.

In the syntax for Python, a text string is anything with...

a)

#

b)

" "

c)

( )

d)

capital letters

89.

Which line starts the loop?

a)

1

b)

5

c)

6

d)

8

90.

How many times will this hero move?

a)

2

b)

4

c)

forever

d)

unknown

91.

What do the values "36,34" mean in line 4?

a)

X = 36, Y = 34

b)

Y = 36, X = 34

c)

Build 36 fences 34 times

d)

Unknown

92.

How many enemies will this hero fight?

a)

0- because enemy should be a text string with " "

b)

1- the one named "enemy"

c)

2- because it says "hero.attack(enemy)" twice

d)

unknown- it will keep attacking enemies until none are left

93.
What is the position of the name 'Paula' in the following list:
names = ["Paul","Phillip","Paula","Phillipa"]
a)
0
b)
1
c)
2
d)
3
94.
Look at the code below and identify which of the statements below are true:

for loopCounter in range(10,101,10):
               
     print(loopCounter)
a)
Starts at 10, goes up to 100, increases by 10
b)
Starts at 10, goes upto 101, increases by 10
c)
Starts at 1, goes upto 100, increases by 1
d)
Starts at 10, goes upto 10, increases by 10
95.
How many times does the following program print the word ‘computer’:

word= "computer"  
for num in range(1,6):
 
    print(word)
a)
5
b)
6
c)
1
d)
0
96.
What will be printed after running this FOR loop:

for number in range(6):
 
    print(number)
a)
The number 6 
b)
The numbers 0 - 5
c)
The number 5
d)
The numbers 1 - 6
97.
What letter will be printed on the screen after running this code:

team = “Manchester United”
letter = name[5]
print(letter)
a)
M
b)
d
c)
e
d)
Nothing prints
98.
What is printed when this program is run:
days = 5 
if days > 6:  
   print(“Month”)

else:  
   print(“Week”)
a)
Month
b)
Week
c)
Day
d)
4
99.

What does the code print?

a)

10

7

4

1

Done

b)

10

9

8

7

6

5

4

3

2

1

Done

c)

Done

d)

10

7

4

1

-2

-5

... and more, running infinitely.

100.

Which line of code would correctly call the function?

a)

power(base, exp)

b)

power(x, y)

c)

ans = power(base, exp)

d)

ans = power(x, y)