Week 2 Quiz
The reading log reads 30 pages a day. What does the last line of this program print?
goal = 300 pages_read = 45 pages_left = goal - pages_read print(pages_left // 30)Select one.
- 8.5
- 9
- 8
- 15
Same reading log, different operator. What does the last line of this program print?
goal = 300 pages_read = 45 pages_left = goal - pages_read print(pages_left % 30)Select one.
- 15
- 8
- 0.5
- 8.5
Trace each name line by line. What does this program print?
x = 5 y = x x = 10 print(y)Select one.
- 10
- 5
- 15
- x
Using operator precedence, what does this line print?
print(2 * 3 ** 2)Select one.
- 36
- 12
- 64
- 18
What happens when this one-line program runs?
print("5" + 3)Select one.
- It prints 8
- Nothing prints, and the last line names TypeError
- It prints 53
- Nothing prints, and the last line names SyntaxError
What does this line print?
print(int(3.9))Select one.
- 4
- 3.9
- 3
- 4.0
What does this line print?
print(round(2.5), round(3.5))Select one.
- 2 4
- 3 4
- 2 3
- 3 3
Which of these values have the type float? Select every value that does.
Select every option that applies.
- 8.5
- 255
- "8.5" (with the quotation marks)
- 5.0
- True
A chatbot tells you that
print(round(2.5))displays 3, because halves always round up. What is the best next step?Select one.
- Accept the claim, since it matches the rounding rule from school
- Ask the chatbot again until it gives the same reply twice
- Switch to a different chatbot with a more confident reply
- Run the line in a Python runner and compare its output with the claim
This program stops, and the last line of its error message names NameError, because Python is case-sensitive and the name Pages was never assigned.
pages = 255 print(Pages)True or false.
- True
- False
Built with The Course Maker · samples.thecoursemaker.com