From 58e5595b9f9195f49fd94c7958227fdf437b6619 Mon Sep 17 00:00:00 2001 From: ASPP Student Date: Mon, 26 Aug 2024 18:29:46 +0300 Subject: [PATCH] fix 'str object has no attribute isin' error --- src/brewing/cooking.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/brewing/cooking.py b/src/brewing/cooking.py index df13e0c..ec142ac 100644 --- a/src/brewing/cooking.py +++ b/src/brewing/cooking.py @@ -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: -- 2.39.5