mirror of
https://github.com/DavidGailleton/42-Piscine_Python.git
synced 2026-03-13 20:56:54 +01:00
9 lines
316 B
Python
9 lines
316 B
Python
def validate_ingredients(ingredients: str) -> str:
|
|
try:
|
|
for ingredient in ingredients.split(" "):
|
|
if ingredient not in ["fire", "water", "earth", "air"]:
|
|
raise ValueError
|
|
return f"{ingredients} - VALID"
|
|
except ValueError:
|
|
return f"{ingredients} - INVALID"
|