NEW
Font size
WorksheetsPython Revision
Total questions: 35
Worksheet time: 18mins
Python uses parenthesis to block off code
True
False
Python uses indentation to block code into chunks
True
False
What output will the console show, if 15 and 30 are entered by the user?
Syntax error
The sum of the two numbers - 45
The concatenation of the two numbers - 1530
Complier error
What result will display in the shell if 15 and 20 is entered by the user?
"num1 + num2"
1520
35
Which one will display when this code is run?
What will be the output of the following code:
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
Which statement correctly assigns the string "Tanner" to the variable name?
Code for Hello, World!
print Hello, World!
print("Hello, World!)
print("Hello, World!")
Code to display the following text:
Five is greater than two!
if 5 > 2:
print("Five is greater than two!")
if 5 = 2:
print("Five is greater than two!")
if 5 > 2: Print("Five is greater than two!")
Code which will give the following output:
257
Hello, World!
x = 257
y = "Hello, World!"
print(y)
print(x)
x = 257
y = "Hello, World!"
print(x)
print(y)
x = 257
y = Hello, World!
print x
print y
Insert the missing part of the code below to output
_________________( "My name is ")
Comments in Python are written with the special character:
brackets
hashtag
coma
Code to display the following:
b is greater than a
a = 33
b = 200
if b > a:
print("b is greater than a")
a = 33
b = 200
if b < a:
print("b is greater than a")
a = 330
b = 200
if b > a:
print("b is greater than a")
The output of the program is:
x = 4
x = "Sally"
print(x)
four
Saly
Sally
What is the Python built-in function used to display numbers and text on the screen?
input
output
command
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(9/3)
3
3.0
9/3
SyntaxError
What will the output be from the following Python code?
print(Hello world!)
Hello world!
SyntaxError
Hello world
print(Hello world!)
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":
