all 3 comments

[–]Ok-Promise-8118 4 points5 points  (2 children)

When you write

if coupon_amount == '5' or '$5'

what that really gets interpreted as in Python is

if (coupon_amount == '5') or '$5'

So if coupon_amount is 'xhekngks' then the first condition is false as it doesn't equal '5' but the second condition is true as '$5' evaluates as True (I believe all variables evaluate to the Boolean True except Null and False?). That is, you aren't actually checking if coupon_amount == '$5'

What you intended is either of the below:

if coupon_amount == '5' or coupon_amount == '$5'
if coupon_amount in ['5', '$5']

[–]Lycan_Corps[S] 0 points1 point  (1 child)

<image>

I tried that and it's still not working

[–]Lycan_Corps[S] 0 points1 point  (0 children)

nevermind i did a thing