Font size
S
M
L
XL
WorksheetsStVirgils Python Loops and Conditionals Quiz
Total questions: 18
Worksheet time: 10mins
Name
Class
Date
1.
I have been working in:
a)
GROK
b)
TYNKER
c)
BOTH
2.
What is the name of the programming language we are learning?
a)
Scratch
b)
Python
c)
Pie thin
d)
Scribble
3.
What will the output be from the following code?
print("Hello world!")
print("Hello world!")
a)
SyntaxError
b)
Hello world!
c)
"Hello world!"
d)
print(Hello world!)
4.
What will the following code do:
print("What is your name?")
print("What is your name?")
a)
Allow you to type in your name
b)
Display the words 'What is your name?' on the screen
c)
Allow you to enter information
d)
Print your name to the screen
5.
What will this code do?
a)
Print Numbers 1-11
b)
Print Numbers 1-10
c)
Print Numbers 2-10
d)
Print Error
6.
What is the output from the following code:
name = "Fred"
print("Hello " + name)
name = "Fred"
print("Hello " + name)
a)
Hello Fred
b)
Hello name
c)
Name error
d)
HelloFred
7.
Which of these is NOT a loop in python?
a)
for loop
b)
while loop
c)
nested loop
d)
if loop
8.
What does “input()” represent in this code?
colour = input(“Enter a colour”)
colour = input(“Enter a colour”)
a)
prompts the user to enter an input
b)
it gives the user a colour
c)
it turns the text that colour
9.
Which of these operators means EQUAL TO?
a)
'='
b)
'=>'
c)
'<='
d)
'=='
10.
What does the '#' allow you to do?
a)
Repeat code
b)
Comment on code
c)
Print code
d)
End code
11.
What will this code print?
a)
Print the word 'letter'.
b)
Print a user input on one line.
c)
Print a user input one letter at a time.
d)
Print an Error.
12.
What does the equal sign mean in this code?
team = input(“Enter a team”)
team = input(“Enter a team”)
a)
variable
b)
equal to
c)
greater than
d)
interger
13.
What is the result of this code?
a)
Issue Driver's License
b)
Almost eligible for Driver's License
c)
No requirements met.
d)
none of these
14.
What will be the output of this code?
a)
1,2,3,4,5,6,7,8,9,10,11,12
b)
0,2,4,6,8,10
c)
2,4,6,8,10,12
d)
2,4,6,8,10
15.
What is syntax?
a)
Syntax is the word used to describe a variable
b)
Syntax is the rules of the programming language
c)
This is used to read information
d)
It is used to output information
16.
a)
You can buy some chocloate
b)
You are rich!
c)
Get a job!
d)
You almost have enough
Get a job!
Get a job!
17.
a)
You can buy some chocolate
b)
You are rich
c)
You almost have enough
d)
Get a job!
18.
The following code is used to create a variable and store a value. Why will it NOT work?
my number = 36
my number = 36
a)
The variable can't store a number
b)
A variable name cannot have any spaces
c)
There variable name can't be called my number
d)
The equals symbol should be at the beginning of the line
Reset
