Font size
WorksheetsPython + Turing Lab + Code Combat + Computaional Thinking
Total questions: 100
Worksheet time: 3hrs 19mins
What is a command?
"An instruction put in between quote marks"
An instruction that tells the computer to perform a certain action.
An instruction put in CAPITAL LETTERS
An instruction that is repeated at least once
What is a computer program?
A computer that has learned to program
A text document written by a computer
A television program on a computer
A set of instructions that tell the computer what to do
What is the name of the programming language we are learning?
Scratch
Python
Turinglab
C#
Which two of these are function calls?
prepare_soil
move_forward()
"tomato"
prepare_soil()
What is a function?
A function is a command that performs a specific action when called
Functions are words that always have brackets after them
Functions are commands that have quotes around them and can be put between brackets
Functions are commands that allow you to convert your code from one language to another
Which function call moves the Farmbot forward?
move_forward()
move_forward
Move_Forward()
moveForward()
Which two of the following are strings?
tomato
'A very large pumpkin'
pumpkins and aubergines
"tomato"
What is an algorithm?
A set of instructions that are to be repeated more than once
A set of commands used to perform a particular task
Any computer program
A command created by Mr. Algo Rhythm
Which of these is a function call?
plant
plant("tomato")
move_forward()
"tomato"
Select the two function calls
move_forward
move_forward()
turn("left")
"left"
Identify which lines of code the strings appear on
2, 3
1, 2
2, 4
1, 3
Select the code that will prepare soil and then plant a tomato
Which of these is an argument in the code shown?
plant()
move_forward()
"tomato"
plant("tomato")
Where is Farmbot going to be after running the code?
Identify the two functions written in snake case
returnHome()
prepare_soil()
turn("right")
move_forward()
Identify the bug in the code shown
Indentation error - caused by incorrect spelling
Name Error - caused by incorrect spelling
Syntax Error - caused by incorrect brackets
Symtax Error - caused by incorrect quote marks
Identify the bug in the code shown
Indentation error - caused by incorrect spelling
Name Error - caused by incorrect spelling
Syntax Error - caused by incorrect brackets
Symtax Error - caused by incorrect quote marks
Identify the bug in the code shown
Indentation error - caused by incorrect spelling
Name Error - caused by incorrect spelling
Syntax Error - caused by incorrect brackets
Symtax Error - caused by incorrect quote marks
Select the two ways of adding a comments in Python
// Move into position
## Harvest a row
/* Plant a row */
# Move into position
Which two students have commented their code effectively?
Which two of these functions have been written using snake case?
plant()
turn()
prepare_soil()
move_forward()
Which of the following is NOT a common error message when writing Python code?
Name Error
Syntax Error
Indentation Error
Spelling Error
What is debugging?
The process of finding bugs in your code
The process of writing bugs into your code
A mistake in your code
The process of finding and removing bugs from your code
Which of the following is the correct way of writing a FOR loop?
Which three of the following describe the benefits of using a FOR loop in your code?
It helps create more readable and maintainable code
It stores useful information for later retrieval
It helps select which path to take in the code
It helps by reducing repetition in a programmers code
It helps create clear and concise code
What kind of programming language is Python?
Block
Text
Picture
Function
Which command is correct?
move_forward()
Move_Forward()
move_forward
move_forward("")
Which command is correct?
returnHome()
return_Home()
return_home()
RETURN_HOME()
Which line of code is the error on?
1
2
3
4
What line of code is missing from here to make farmbot plant two potatoes?
(a)
Every game & app has been created using a programming language:
True
False
Is the following code snake case or camel case?
returnHome()
Snake case.
Camel case.
Neither.
Is the following code snake case or camel case?
return_home()
Snake case.
Camel case.
Neither.
A syntax error means your code has a 'grammar' mistake or you used symbols incorrectly.
True
False
What symbol is used in Python to assign values to a variable?
equals =
plus +
forward slash /
asterisk *
The statement using the and operator results true if _______
both operands are true
both operands are false
either of the operands is true
first operand is true
Which of these is correct Python conditional statement?
IF answer == "Yes":
if answer == "Yes"
if answer == "Yes":
if answer = "yes":
What is a String?
A data type that contains whole numbers. eg: 3, 45, 124
Numbers with decimal point. eg: 0.5, 2.45, 56.04
Group of characters between quotation marks. eg: "dog"
Data type that can only be True or False.
Which of these operators means EQUAL TO?
'='
'=>'
'<='
'=='
Will the lights be on or off at 10 o’clock?
Select one of the following
Off
On
In the code below, which of the values are variables?
Select one or more of the following
time
print()
get_time()
is_dark
Select a logical operator
if
and
else
>=
What does the colon : symbol tell the computer?
codes that come after it are part of it
codes that are indented under it are part of it
codes that have arguments will be played
codes that are variables will be ignored
What will this code do?
Print Numbers 1-11
Print Numbers 1-10
Print Numbers 2-10
Print Error
When writing an if/else statement, you
always indent the line after the condition
never indent the line after the condition
capitalize every word
put a colon at the beginning and the end
Which of the following is not done by abstraction?
Identifies essential details
Disregards non-essential information
Breaks the problem down into smaller tasks
Which of the following is not done by decomposition?
Allows multiple people to work on the problem together
Disregards non-essential information
Breaks the problem down into smaller tasks
When drawing a dog, which of the following characteristics is non-essential?
Dogs have 4 paws
Dogs have fur
Dogs have brown fur
When designing a building that must be accessible for wheelchairs, which of the following characteristics is non-essential?
Number of doors
Number of walls
Number of wall paintings
One advantage of abstraction is that it means no mistakes can be made
True
False
You could use abstraction to replace specific objects with simple shapes
True
False
This is a good example of decomposition
Sit down
Do homework
True
False
Decomposition allows each task to become _______
More manageable
Easier
Quicker
Decomposition allows the entire task to be completed as _____
A Team
A Whole
Quickly as possible
Abstraction and Decomposition are separate concepts, you would usually choose to do either one or the other
True
False
It is always necessary to decompose a task
True
False
Abstraction and Decomposition are examples of...
Computational Thinking
Algorithmic Thinking
Computer Science
Logical Reasoning
What is pattern recognition?
Breaking down a complex problem into smaller problems
Looking for similarities among and within problems
Building models from patterns
Why do we need to look for patterns in problems?
Patterns make it easier for us to solve complex problems
We don't need to look for patterns
Patterns make it more difficult complex problems
If you don't look for patterns in a problem, your solution might be _____
Wrong
Inefficient
Too slow
Identifying the steps involved in solving a problem
Abstraction
Decomposition
Pattern Recognition
Algorithmic Thinking
Looking for similarities and trends within a problem
Abstraction
Decomposition
Pattern recognition
Algorithmic Thinking
What is a flowchart?
A visual representation of an algorithm.
A diagram that shows abstraction.
A series of shapes.
A school database has lots of information on students, the data manager needs to use abstraction. What data should she leave out?
Age
Guardian's phone numbers
Classes
Eye colour
Which line of code is correct?
hero.MoveLeft()
heroMoveLeft();
hero.moveleft(:
hero.moveLeft()
Which line of code will make the hero move up 4 times?
4.hero.Move.Up();
hero.MoveUp(4);
hero.4MoveUp();
hero.Move4Up();
What must every line of code end with?
comma ,
semi-colon ;
parantheses ()
period .
Which line of code will attack Kratt?
hero.attack("Kratt")
hero.attack("kratt");
hero.attack(Kratt);
Hero.Attack.Kratt;
What is the correct way to write a while loop?
while {
while.true {
while (loop)
while True:
How do you create a variable for enemy1 Gert?
enemy1 = "Gert"
enemy1 = Gert
var.enemy1 = Gert;
var.Enemy.1 = "Gert";
You can enter a number as an argument to instruct your object to move more than one space at a time.
True
False
It is not important to capitalize the name of the variables.
True
False
A string will always have quotation marks.
True
False
What is the main reason we use loops?
It saves time
It is faster to create
It is easier to type
To repeat a block of code without having to retype
Which of the following is a comment? PICK ALL ANSWERS THAT ARE CORRECT!
#Move towards the gem
#Don't touch the spikes!
#Type your code below and click Run when you're done
hero.moveRight()
What is the sprite in this program?
Gem
Spikes
Run
Hero
Which line includes the command?
1
2
3
5
What term describes the rules we use for a language? For example, Python uses dot-notation.
Commands
Functions
Syntax
Variables
What is the argument in this code?
hero
move
Right
3
How many times will this hero move?
5
6
10
Unknown
What is the text string in this program?
hero
moveRight
attack
"Brak"
In the syntax for Python, a text string is anything with...
#
" "
( )
capital letters
Which line starts the loop?
1
5
6
8
How many times will this hero move?
2
4
forever
unknown
What do the values "36,34" mean in line 4?
X = 36, Y = 34
Y = 36, X = 34
Build 36 fences 34 times
Unknown
How many enemies will this hero fight?
0- because enemy should be a text string with " "
1- the one named "enemy"
2- because it says "hero.attack(enemy)" twice
unknown- it will keep attacking enemies until none are left
names = ["Paul","Phillip","Paula","Phillipa"]
for loopCounter in range(10,101,10):
print(loopCounter)
word= "computer"
for num in range(1,6):
print(word)
for number in range(6):
print(number)
team = “Manchester United”
letter = name[5]
print(letter)
days = 5
if days > 6:
print(“Month”)
else:
print(“Week”)
What does the code print?
10
7
4
1
Done
10
9
8
7
6
5
4
3
2
1
Done
Done
10
7
4
1
-2
-5
... and more, running infinitely.
Which line of code would correctly call the function?
power(base, exp)
power(x, y)
ans = power(base, exp)
ans = power(x, y)
