WorksheetsPython Programming
Total questions: 37
Worksheet time: 27mins
What is a program?
A series of a step-by-step instructions that tell a computer how to solve a task
A video that is watched on a computer
A flowchart written on a computer
The make and model of a computer
What does the print command do?
Outputs a hard copy of a program to a printer
Outputs a message on screen
Print a hard copy of a flow chart to a printer
Prints out the the commands line by line on the screen
How do we get user input from the keyboard?
input = (What is your name?)
input = What is your name?
output = ("What is your name?")
input("What is your name? ")
Which data type is the most suited to store a telephone number in a variable?
string
integer
float
boolean
Which data type would you use for the quantity of stock in a shop?
integer
float
string
boolean
If you want to change the data type to an integer which line of code would you use?
int ("How much pocket money do you have?")
input("How much pocket money do you have?")
int(input("How much pocket money do you have?"))
int = ("How much pocket money do you have?")
How many statements are in this line of code?
print("If I do well in computing, I will find most subjects easy")
2 - print and if
0 - there are no statements
1 - print
What will be the output?
name = "Dave"
print (name)
Dave
name
"Dave"
(name)
What is an input?
To plug in something
A function that allows us to ask the user to enter some data
Data displayed on a screen
A routine
A variable must have been assigned (given) a value before that value is referenced (used).
True
False
The correct way to convert user input is:
birth_year = number(input())
birth_year = int(input())
birth_year = (input(int))
birth_year = int(input)
To display the following on screen Hello World! the following command should be used:
print(Hello World!)
print("Hello World" + !)
print("Hello World!")
print"(Hello World!)"
You assign a value to a variable with which symbol
@
==
=
*
The code you use to receive and input from the keyboard
enter()
add()
receive()
input()
Program statements are executed in sequence, one after the other...
True
False
If the coding steps are in the incorrect order, the computer can still execute the program.
True
False
How many variables are there in this program?
2
3
4
5
What would be the output of this program if the user input was 10?
22.04
220.4
2204
Error wrong data type
What data type represents a whole number?
Float
Int
Boolean
String
How many errors are there in this code?
1
2
3
4
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
What commend is used to check if two values are the same
==
=
+
*
This line of code will generate an error?
if x= 7:
True
False
This line of code will generate an error
if x==7
false
true
What will be printed on the screen when you run this program?
x=7
y=6
z=x+y
print (z)
7
6
13
error message
What will be printed on the screen if the user enters the value Dave when asked to enter their name when this program is run?
x= 7
y= 6
name = input("Please enter your name")
print ("Hi, 6+7 =13")
Hi Dave 6+7 = 13
Hi Dave
6+7 = 13
Hi, 6+7 = 13
What will be output if the user enters Fred
name = input("Please enter your name")
print ("Name")
Fred
Dave
Error Message
Name
What will be output if the user enters Fred
name = input("Please enter your name")
print ("name)
Fred
Hi Fred
Name
Error Message
What will be output if the user enters Fred
name = input("Please enter your name")
print (name)
Name
Fred
Hi Fred
Error Message
In Scratch you cannot assign a value to a variable but you can in Python
False
True
What will the program print out when this is run?
x= 1
while x<7:
if x == 5:
print (x)
x=x+1
1,2,3,4,5,6,7
7
5
Error Message
