samedi 26 septembre 2020

Is there a way to make OR conditionals span multiple lines? [duplicate]

In a text-based adventure I'm programming, I've been coding IF statements to allow for multiple lines of conditionals, like so:

    if certain_input == (
                       "examine bed" or "look at bed" or "look bed" or "look straw" or "inspect straw" or
                       "inspect bed" or "search bed" or "examine straw" or "look at straw"
                      ):
        print("this input has been fulfilled")

The only conditionals that work in this format are "examine bed" and "inspect bed". Every other listed option returns an error when used. Is there something I am missing?

Aucun commentaire:

Enregistrer un commentaire