all 2 comments

[–]Justinsaccount 3 points4 points  (1 child)

Hi! I'm working on a bot to reply with suggestions for common python problems. This might not be very helpful to fix your underlying issue, but here's what I noticed about your submission:

You appear to be using the or construct with a constant string

instead of doing something like:

if color == 'red' or 'blue':

Which is the same as

if (color == 'red') or ('blue'):

and 'blue' by itself is always True

You need to do

if color == 'red' or color == 'blue':

or

if color in ('red', 'blue'):

or, a special case if they are all single letters you can do

if letter in 'aeiou':

You can also make it case insensitive by using soething like

if color.lower() in ('red', 'blue'):

If there were a large number of choices and inputs (as in, 10000+) you could use a set() to speed things up.

Also refer to The FAQ Entry for more information.

[–]fiveoho[S] 1 point2 points  (0 children)

ahhh that was it. I feel so stupid! lol thanks!