Programming
Questions
Instructions
Below are 8 multiple choice questions.
Select the correct outcome for the code provided then click "Submit" to reveal the answers.
Questions
Question 1
print (“Hello, world!”)
Puts the words “Hello, world!” on to the computer screen
Sends the words “Hello, world!” to any connected printer
Please select an answer
Question 2
foo = 200
print(foo)
Put the word “foo” on the computer screen
Put the number “200” on the computer screen
Please select an answer
Question 3
myname = “Alex”
print (“Hello”, myname)
Put “Hello Alex” on the screen
Put “Hello, Alex” on the screen
Please select an answer
Question 4
a = 14
b = 16
c = a + b
print(c)
Prints the number 14 on the screen
Prints the number 16 on the screen
Prints the number 30 on the screen
Please select an answer
Question 5
a = 10
b = 5
c = 3
d = a + b * c
print(d)
Prints the number 45 on the screen
Prints the number 25 on the screen
Please select an answer
Question 6
a = 1
if a == 5:
print(“a is 5”)
It does nothing
It prints the text “a is 5”
Please select an answer
Question 7
a = 1
while a <= 5:
print(“a is”,a)
a =+ 1
Prints “a is 1”, “a is 2”, “a is 3”, “a is 4”, “a is 5”, then stops
Prints “a is 1” five times on the screen
Please select an answer
Question 8
list = [2,4,6,8]
for a in list:
print(“a is”, a)
Prints “a is 2”, “a is 4”, “a is 6”, “a is 8”
Prints “a is 2,4,6,8”
Please select an answer
Submit