QUESTION IMAGE
Question
- what is output by the code below?
temp = 19
if temp >= 212:
print(\boiling\)
elif temp <= 32:
print(\freezing\)
a. 19
b. true
c. boiling
d. freezing
e. there is no output.
- what is output by the code below?
x = 250
width = 50
print(\moving right\)
if x + width > 800:
print(\hit edge\)
a. moving right
b. hit edge
c. true
d. false
e. moving right hit edge
- what is output by the code below?
score = 200
highscore = 310
if score > highscore:
print(\you beat the high score by\, score - highscore, \points!\)
else:
print(\you needed\, highscore - score, \points\)
a. you beat the high score by 110 points!
b. you needed 110 points
c. 110
d. 310
e. 200
Step1: Analyze the condition in the code
In the code score = 200 and highScore = 310. The condition score > highScore is \(200>310\), which is false.
Step2: Execute the else - part
Since the condition is false, the else part of the code is executed. The calculation highScore - score is \(310 - 200=110\).
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
b. You needed 110 points