0
what do i have to do to make this work
--- = tab while True: ---userInput = input(">>> ") ---if userInput in ['hi', 'HI', 'Hi']: ------print("Hello") ---else: ------print("I did not understand what you said")
5 Answers
+ 1
What is this piece of code supposed to do?
+ 1
Whatever. Use this.
while True:
try:
userInput = input()
if userInput in ["hi", "HI", "Hi"]:
print("Hello")
else:
print("I did not understand what you said")
except EOFError:
break
0
# the online testing environment is not setup
# to accept repeated input with python the best
# it does is handle a single entry
userInput = input("You say : ")
if userInput in ['hi', 'HI', 'Hi']:
print(userInput, ' I say Hello')
else:
print(userInput, " I say I did not understand you")
0
it's ai
0
thank you guys