ACTIVITY 16 / 50
Try as many times as you needMore than two choices
Let’s understand
elif checks another condition if the earlier ones were false. Python chooses the first true branch and skips the rest. The order of the checks matters. else can handle everything remaining.
Listen to the explanation
Example
n = 5
if n < 2:
print("A")
elif n < 7:
print("B")
else:
print("C")Read a seed count. Below 3: SMALL. From 3 to 5: MEDIUM. From 6: LARGE.
I need a hint
After checking < 3, the next check can simply be < 6.
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.
Мой профиль