fix 'str object has no attribute isin' error

This commit is contained in:
ASPP Student 2024-08-26 18:29:46 +03:00
parent 8b893a0008
commit 58e5595b9f

View file

@ -18,10 +18,10 @@ def stir(potion, direction):
direction : {'clockwise', 'anti-clockwise'} str
The direction in which the potions is to be stirred
"""
if direction.isin(["clockwise", "clock_wise", "clock-wise"]):
if direction in ["clockwise", "clock_wise", "clock-wise"]:
potion.colour = "vomit-yellow"
print('Your potion turns a revolting vomit-yellow.')
elif direction.isin(["anti-clockwise", "anticlockwise", "anti_clock_wise", "anti-clock-wise"]):
elif direction in ["anti-clockwise", "anticlockwise", "anti_clock_wise", "anti-clock-wise"]:
potion.colour = "newt-green"
print('Your potion turns a lovely newt-green.')
else: