dimanche 20 septembre 2020

Logical operatin in python: Value 1 or Value 2 not in list

Why does thins not work:

if "update" or "create" not in sys.argv:
    usage()
$ python myScript.py update
# In if

$ python myScript.py create
# In if

Goal: How can I check if neither "update" nor "create" is in the list, then the code in the if statement runs?

Aucun commentaire:

Enregistrer un commentaire