WorksheetsPython lesson 3
Total questions: 11
Worksheet time: 6mins
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.
Which statement correctly assigns the string "Tanner" to the variable name?
a)
name = print( "Tanner")
b)
input("Tanner")
c)
name = "Tanner"
d)
name = input("Tanner")
8.
Code for Hello, World!
a)
print Hello, World!
b)
print("Hello, World!)
c)
print("Hello, World!")
9.
Code for
Five is greater than two!
a)
if 5 > 2:
print("Five is greater than two!")
b)
if 5 = 2:
print("Five is greater than two!")
c)
if 5 > 2: Print("Five is greater than two!")
10.
Insert the missing part of the code below to output
_________________ "My name is ".
a)Print
b)PRINT
c)print
11.
What does this function do?
input()
a)
Opens the CD tray.
b)
Asks the user to type something in.
c)
Displays the word 'input'.
d)
Exits the program.
100 %
