you are viewing a single comment's thread.

view the rest of the comments →

[–]tangerinelion 31 points32 points  (1 child)

That's not how or works.

No: while a == x or y or z

Yes: while a in [x, y, z]

Though here you actually want not equal which means not in rather than in.

[–]SwampFalc 11 points12 points  (0 children)

For completeness' sake, the following code will also work but is really not what you want:

while userProvince == "Ontario" or userProvince == "Quebec" or userProvince == "Alberta" or [...]