Name: Anonymous 2010-10-17 12:08
if operator != ("add"|"sub"):
print ("Invalid Operator")
Basically I want to check if operator has anything other than "add" or "sub" assigned to it, but python 2.6 is saying
TypeError: unsupported operand type(s) for |: 'str' and 'str'
How should I check if operator is anything other than add or sub?
print ("Invalid Operator")
Basically I want to check if operator has anything other than "add" or "sub" assigned to it, but python 2.6 is saying
TypeError: unsupported operand type(s) for |: 'str' and 'str'
How should I check if operator is anything other than add or sub?