mirror of
https://github.com/DavidGailleton/42-Piscine_Python.git
synced 2026-04-29 00:24:34 +02:00
WIP: part 4 of module 6
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
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"
|
||||
Reference in New Issue
Block a user