I am new to python, I have been trying to use the text to speech module it works fine but when I try to add an OR operator to my if..elif..else block the program discards everything below the elif statement that contains the OR operator, any help will be greatly appreciated. Code provided below
def response(text):
if text != "":
if 'hello jarvis' in text:
print("hello sir, how can i help you")
speak("hello sir, how can i help you")
elif 'how are you' in text:
print("I'm fine sir, how are you?")
speak("I'm fine sir, how are you?")
elif 'are you alive' in text:
print("no i am not alive, i am just a combination of very complex algorithms that keeps me functional")
speak("no i am not alive, i am just a combination of very complex algorithms that keeps me functional")
elif 'what is the time' or 'what time is it' in text:
strtime = datetime.today().strftime("%H:%M:%p")
print(f"the time is {strtime}")
speak(f"the time is {strtime}")
elif 'thank you' in text:
speak("you are welcome sir")
exit()
else:
url = f"https://www.google.com/search?q={text}"
webbrowser.get().open(url)
speak("here is what i found")
else:
speak("call me when you have something to ask me")