Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Python help

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?

Name: Anonymous 2010-10-17 16:13

if not operator in ("add", "sub"):
    print ("Invalid Operator")

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List