samedi 8 octobre 2016

Python ifs with ors [duplicate]

This question already has an answer here:

How can i get something like

def config():
        if "--silent" or "-s" in sys.argv or input:
                silent = True
                print("Silent")
    elif "--count" or "-c" in sys.argv or input:
            print("Counting something")
    else:
            print("Command not found")

to work? The program only prints "Silent". Why is that?

Aucun commentaire:

Enregistrer un commentaire