WorksheetsPython outputs
Total questions: 20
Worksheet time: 15mins
Name
Class
Date
1.
What will the output be from the following code?
print(Hello world!)
print(Hello world!)
a)
Hello world!
b)
SyntaxError
c)
Hello world
d)
print(Hello world!)
2.
What will the output be from the following code?
print("Hello world!")
print("Hello world!")
a)
SyntaxError
b)
Hello world!
c)
"Hello world!"
d)
print(Hello world!)
3.
What will the output be from the following code?
Print("Hello world!")
Print("Hello world!")
a)
NameError
b)
Hello world!
c)
"Hello world"
d)
Print(Hello world!)
4.
What will the output be from the following code?
print(3+4)
print(3+4)
a)
3+4
b)
7
c)
SyntaxError
d)
print(3+4)
5.
What will the output be from the following code?
print("3+4")
print("3+4")
a)
7
b)
3+4
c)
34
d)
SyntaxError
6.
What will the output be from the following code?
print(3*4)
print(3*4)
a)
34
b)
7
c)
12
d)
3*4
7.
What will the output be from the following code?
print(3*4+5)
print(3*4+5)
a)
27
b)
17
c)
12
d)
SyntaxError
8.
What will the output be from the following code?
print("3*4+5")
print("3*4+5")
a)
SyntaxErrror
b)
17
c)
3*4+5
d)
12
9.
What will the output be from the following code?
print(9/3)
print(9/3)
a)
3
b)
3.0
c)
9/3
d)
SyntaxError
10.
What will the output be from the following code?
print(9/3*2+4-5)
print(9/3*2+4-5)
a)
19
b)
5.0
c)
0.5
d)
5
11.
What will the output be from this code?
a)
Hello world!
b)
Hello + world!
c)
SyntaxError
d)
"Hello" "world!"
12.
What will the output be from this code?
a)
Hello world today
b)
"Hello" "world" "today"
c)
Hello + world + today
d)
SyntaxError
13.
What will the output be from the following code?
print("Hello" + 2 + "world")
print("Hello" + 2 + "world")
a)
Hello 2 world
b)
Hello2world
c)
TypeError
d)
HelloHelloworld
14.
What will the output be from the following code?
print("Hello world!" * 2)
print("Hello world!" * 2)
a)
TypeError
b)
Hello world world!
c)
Hello world!Hello world!
d)
Hello world! * 2
15.
What will the output be from the following code?
print("Hello world!" * 2 * "Hello world!")
print("Hello world!" * 2 * "Hello world!")
a)
TypeError
b)
Hello world! Hello world! Hello world! Hello world!
c)
Hello Hello World! World!
d)
Hello world! Hello world!
16.
What will the output be from the following code?
print("Hello world!\nHello world!")
print("Hello world!\nHello world!")
a)
Hello world! Hello world!
b)
Hello world!
Hello world!
Hello world!
c)
SyntaxError
d)
Hello world!
17.
What will the output be from the following code?
a)
Hello 2 you!
b)
Hello!
c)
Hello Hello world! world!
d)
SyntaxError
18.
What is the correct term for joining elements together in a string?
(a)
19.
Which Python command is used to output information to the screen?
(a)
20.
What is syntax?
a)
Syntax is the word used to describe an error
b)
Syntax is the rules of the programming language
c)
It is used to read information
d)
It is used to output information
100 %
