I am trying to make a voice assistant. Hence there is lots of problem with it. But this time I am facing very strange problem in if statement. First of all I share my code:
greeting() # greeting mesaage
ear = listen() # listen my voice stored in ear variable
mind = str(recognise(ear)) #recogniser convert it in text by help of google and store in mind variable
if "what"and"about"and"you" in mind:
speak(" i am also fine!")
speak("what can i do for you?")
elif "information" in mind:
speak("what you want to know from me, sir!")
Here problem is that whenever I speak one of the word "what" or "about" or "you" even with "information" it is execute if statement rather than elif statement. While as per my understanding it must be pass from if statement whenever this 3 words are in same string. so I am confused what is mine mistake to code it. Please suggest me friends.
Aucun commentaire:
Enregistrer un commentaire