The Digital Botanist

The Digital Botanist

Welcome to the greenhouse! Your mission is to create a "smart" assistant that can give perfect watering advice for different types of plants. You'll write a function that acts as the brain of this assistant.

The Rules of Botany (and Function Logic):

  1. The Safety Rule - If the soil is already damp (is_soil_damp is True), you should never water the plant, regardless of any other condition.

  2. Succulents ("Succulent") - These desert plants are sensitive to overwatering. Do not water them if they have been watered in the last 12 days.

  3. Tropicals ("Tropical") - These plants love moisture. Water them if it has been more than 3 days since their last watering.

  4. All Other Plants ("Default") - For any other plant type, follow a general rule: water them if it has been more than 7 days since their last watering.

  5. Error Handling - if plant_type is not one of the types you handle, return respective message.

  6. Borderline Cases - If it's the last day of a period, recommend to check at the next day.

Based on a set of rules, the function must return a string with the correct advice: "Do not water", "Water the plant", "Unknown plant type" or "Check the soil again tomorrow".

Input: Three arguments: plant_type as string (str), days_since_watering as integer (int) and is_soil_damp as logic value (bool).

Output: String.

Examples:

assert get_watering_advice("Succulent", 11, True) == "Do not water"
assert get_watering_advice("Tropical", 3, False) == "Check the soil again tomorrow"
assert get_watering_advice("Default", 8, False) == "Water the plant"
assert get_watering_advice("Plant", 8, False) == "Unknown plant type"