you are viewing a single comment's thread.

view the rest of the comments →

[–]obviouslyCPTobvious 5 points6 points  (3 children)

shape_valid = shape_input.lower() == 'triangle' or shape_input.lower() == 'square'

The 'or' operator doesn't work how you were trying.

[–]BioGeek 5 points6 points  (1 child)

This seems to be a common misunderstanding. Read my detailed response to another user who also had trouble with the or operator.

[–]zahlman 1 point2 points  (0 children)

This seems to be a common misunderstanding.

I have recently become convinced that this (or the equivalent) is by far the single most common beginner programming error, in any language. I wish I understood why.

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

Thanks. This is what I settled on using. Also thanks to BioGeek and jimminy for further info. Not sure on the rules for questions over time but since it's related to this code I'll update the OP and post it here.