ACTIVITY 37 / 50
Try as many times as you needGreenhouse helper
Let’s understand
A function can contain a condition and return different answers. Each return ends the current call. Separating the decision from input makes it easier to test different values.
Listen to the explanation
Example
def sign(n):
if n > 0:
return "PLUS"
return "OTHER"Define advice(water). Return WATER if water < 3, otherwise OK. Read a number and print the advice.
I need a hint
Return quoted strings. Keep print outside the function.
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.
Мой профиль