I am trying to create an if/else construction that checks if certain parameters are present in the input.

def params(parameters):
if "-a" or "-b" or "-c" in parameters:
    print parameters, "are in your params"
else:
    print "Nothing is in your params"

parameters = raw_input('Enter your params: ') params(parameters)

When I input any of the wanted parameters the program works, but if I enter something different such as -w it says that it is in the parameters, which it shouldn't. How do I fix this? Any help would be greatly appreciated :)

0 Answers