WorksheetsPython Lesson 2
Total questions: 15
Worksheet time: 8mins
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 will be the output?
name = "Dave"
print (name)
a)
Dave
b)
'Dave'
c)
name
d)
(name)
5.
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
a)
True
b)
False
6.
What Python command lets the user enter an answer to a question?
a)
answer()
b)
open()
c)
print()
d)
input()
7.
In the following code, "city" is an example of a what?
a)
List
b)
Loop
c)
Variable
d)
Array
8.
What will the output be from the following code?
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
9.
Which of the following is a float?
a)
new_var = 1234
b)
new_var = True
c)
new_var = 1.234
d)
new_var = "True"
10.
A _____________ expression is an expression that is either true or false.
a)
boolean
b)
truth
c)
variable
d)
conditional
11.
What does an IF statement do?
a)
Closes the program
b)
Makes a decision
c)
Asks a question
12.
Comments are used to make code easier to read.
a)
True
b)
False
13.
The second part of if, that is executed when the condition is false
a)
if
b)
else
c)
for
d)
input
14.
A data type consisting of numbers, letters and symbols.
a)
String
b)
Integer
c)
Float
d)
Boolean
15.
What is syntax?
a)
Syntax is the word used to describe an error
b)
Syntax is the rules of the programming language
c)
It is used to read information
d)
It is used to output information
100 %
