python if statement not working -


this question has answer here:

my python code isn't working. outputs "hi!" regardless of input.

wifipswd = '3jufjf34af3llrac' usrin = '' print("maxi ai v0.2 booting...") print("....") print("....") print("....") print("....") print("....") print("....") print("....") print("....") print("....") print("....") print("....") print("....") print("....") print("....") print("....") print("boot succesful") print(" hi, i'm maxi virtual assistant! ") usrin = input(" ") if usrin == "hi" or "hi" or "hello" or "hello" or "hey" or "hey" or       "hi!" or "hi!" or "hello!" or "hello!" or "hey!" or "hey!" or "hi?" or "hi?" or "hello?" or "hello?" or "hey?" or "hey?" or "hi." or "hi." or "hello." or "hello." or "hey." or "hey." or "bonjour" or "bonjour" or "bonjour!" or "bonjour!" or "bonjour?" or "bonjour?" or "bonjour." or "bonjour." or "hola" or "hola" or "hola!" or "hola!" or "hola?" or "hola?" or "hola." or "hola." :        print("hi!") elif usrin == "bye" or "bye" or "bye-bye" or "bye-bye" or "see later" or "see later" or "bye!" or "bye!" or "bye-bye!" or "bye-bye!" or "see later!" or "see later!" or "see later" or "see later!" or "bye-bye" or "bye-bye!" or "bye." or "bye." or "bye-bye." or "bye-bye." or "bye-bye." or "see later." or "see later." or "see later." or "au revoir" or "au revoir" or "au revoir" or "au revoir!" or "au revoir!" or "au revoir!" or "au revoir." or "au revoir." or "ciao" or "ciao" or "ciao!" or "ciao!" or "ciao." or "ciao." :             print("bye...") elif usrin == "wifi password" or "wifi password" or "wifi password" :       print( wifipswd ) else:       print("i don't understand.") 

ive tried using multiple ifs instead of elifs still doesn't work

the issue need have check after each part of if statement.

right after checks "hi" reads true because 'hi' true value change of stements like

if usrin == "hi" or usrin =="hi" or usrin =="hello" or usrin =="hello" ... 

that way checks


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -