Мой профиль
ACTIVITY 37 / 50

Greenhouse helper

Try as many times as you need

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"
YOUR MISSION

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
  1. Read the last line of the error message.
  2. Find the indicated line. Check quotes, parentheses and indentation.
  3. Change one thing and run again.

main.py

4 spaces

Your draft stays in this browser.

Result

Python
Your program’s output will appear here. Click Run.