This code should be printing "I am unit Alpha 07" when the user says something like "what's your name", but for some reason the if statement never returns true. Please help!
import difflib
while True:
talk = input("Please say something > ")
temp = (difflib.get_close_matches(talk, ['What is your name?', 'Hello', 'peach', 'puppy'],1,0.2))
print(temp)
if temp == "['What is your name?']":
print("I am unit Alpha 07")
break
continue
input()
Sorry if this is really stupid.
Aucun commentaire:
Enregistrer un commentaire