NEW
Font size
WorksheetsPython input, output, and errors
Total questions: 14
Worksheet time: 8mins
What is a programming language?
Written English
An artificial language used to program a computer
A language used in pseudocode
Machine code
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?")
name=input("What is your name? ")
Which data type would you use for the quantity of stock in a shop?
integer
float
string
boolean
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
What is the term for an error that a programmer makes in their code so the program won't run?
Program error
Syntax error
Code error
Logic error
What data type would you use to represent the price of an item?
integer
float
Boolean
String
Which of the following variable names is NOT allowed to be used?
first_name
name1
name#1
lastName
The following is an example of what type of error?
print("Here is some text")
print(1/0)
Syntax Error
Run-time Error
Logical Error
The following is an example of what type of error?
print("Here is some text"
print(6/2)
Syntax Error
Run-time Error
Logical Error
The following code to calculate an average is an example of what type of error?
x = 2
y = 6
average = x + y / 2
print(average)
Syntax Error
Run-time Error
Logical Error
Improper indentation is an example of what type of error?
Syntax Error
Run-time Error
Logical Error
