NEW
Font size
WorksheetsPython Quiz II
Total questions: 30
Worksheet time: 30mins
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
What is the Python built-in function used to display numbers and text on the screen?
input
output
command
If you want to create an empty list called colours in Python, which of the following is correct?
colours = [ ]
colours = ( )
colours = { }
colours = <>
Each item in a list has an index. What is the first index in a Python list?
0
1
a
A
What will the output be from the following code?
print(3+4)
3+4
7
SyntaxError
print(3+4)
What would this print?
What will the output be from the following Python code?
Print("Hello world!")
NameError
Hello world!
"Hello world"
Print(Hello world!)
What will the output be from the following Python code?
print(9/3)
3
3.0
9/3
SyntaxError
What is the Python built-in function to converts a number to a string?
str()
int()
parseInt()
convert
Which of these is correct Python conditional statement?
IF answer == "Yes":
if answer == "Yes"
if answer == "Yes":
if answer = "yes":
print("3+4")
Which of these is a string?
42
True
"This one!"
No, this one
Why would you use a loop?
To repeat a piece of code
To create a loop
To input data
Which python operator means 'less than or equal to'?
>=
>
<
<=
