WorksheetsPython 1
Total questions: 20
Worksheet time: 10mins
print("Hello world!\nHello world!")
Hello world!
print(Hello world!)
What syntax can you use to insert a line break between strings so that they appear over new lines?
/
\n
\l
n
print("Hello world!" * 2)
What is Python
High level programming language
Software program
Operating System
Microsoft Application
Which is the best definition of an algorithm?
a line of computer code with input
a process to be followed to solve a problem
a programming language that uses symbols
a description of a future event
Which is the best definition of a variable?
A unit of measurement used in programming
A function used for inputting data
A string that can never change
A stored value with an associated name
What is the correct code to ask for a user’s favourite animal and store it in memory?
animal = input(“What is your favourite animal?”)
input = animal(“What is your favourite animal?”)
animal(“What is your favourite animal?”)
input(What is your favourite animal?)
What would be the output of the following code? - #print(“3 + 5”)
No output
8
3+5
Error message
What would be the output of the following code? - print(“3 + 5”)
No output
8
3+5
Error message
What would be the output of the following code? - print(3 + 5)
No output
8
3+5
Error message
Which of these statements about while loops is true?
While loops always execute the same number of times
While loops always execute at least once
While loops must have a condition
While loops must not contain an “if” statement
12. In Python, "Seventeen" is an example of what data type?
string
integer
boolean
float
12. In Python, 17 is an example of what data type?
string
integer
boolean
float
12. In Python, "17" is an example of what data type?
string
integer
boolean
float
12. In Python, True or False is an example of what data type?
string
integer
boolean
float
12. In Python, 1.5 is an example of what data type?
string
integer
boolean
float
True or False: A syntax error means there is an error in the way a programme has been written. eg a spelling mistake, typo or missing character like a bracket or colon
True
False
