Master Python
Section quiz
Contents
0 of 253 complete
Six questions on print, quotation marks, the arithmetic you get for free, and the first errors.
Questions are shuffled within each part, and so are the answers. You can retake it as often as you like.
Which of these writes out Total: 750?
Total: 750
print(f"Total: {3 * 250}")
print("Total: {3 * 250}")
print("Total: " + 3 * 250)
print(f"Total: 3 * 250")
What does print("2 + 2") write out?
print("2 + 2")
2 + 2
"2 + 2"
4
What does print("3" + "4") write out?
print("3" + "4")
34
3 4
7
What does print("Use # for comments") write out?
print("Use # for comments")
Use # for comments
Use
print("Age:" + 30) stops the program. Which error is it, and why?
print("Age:" + 30)
+
30
A problem asks for a function called double. You write def double(n): and then, indented under it, print(n * 2). The right numbers appear on the screen and every test fails. Why?
double
def double(n):
print(n * 2)
n * 2
n + n
number
None
6 questions left to answer.