You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
-
Ok I understand that writing: if not vacation and day==0 or day==6: inadvertently assigns (alarm_clock(6,True)) as '10:00' but why does it also assign (alarm_clock(6,False)) as '10:00' aswell?user16712533– user167125332021年08月20日 09:32:45 +00:00Commented Aug 20, 2021 at 9:32
-
AND is proceeded before OR, check this post for further explanation.Mig B– Mig B2021年08月20日 09:58:43 +00:00Commented Aug 20, 2021 at 9:58
-
Without parenthesis, if not vacation and day==0 or day==6: return"10:00" is processed as "False and False or True" but alarm_clock(6, False) → '10:00' . Wouldn't "if vacation and (day==0 or day==6): return 'off' " assign it as "off" ?user16712533– user167125332021年08月20日 10:16:40 +00:00Commented Aug 20, 2021 at 10:16
lang-py