ACTIVITY 14 / 50
Try as many times as you needIf it gets cold
Let’s understand
if runs a block only when its condition is true. End the condition with a colon. Indent the lines inside the block by four spaces. Indentation is part of the language, not decoration.
Listen to the explanation
Example
water = 2
if water < 3:
print("WATER")Read a temperature. If it is below 10, print HEAT. Otherwise print nothing.
I need a hint
Use temperature < 10. Indent print.
How to find an error
- Read the last line of the error message.
- Find the indicated line. Check quotes, parentheses and indentation.
- Change one thing and run again.
main.py
4 spaces
Your draft stays in this browser.
Result
PythonYour program’s output will appear here. Click Run.
Мой профиль