Hello, i am trying to make a program that recognizes a certain word from a list (as shown below),
My main problem is-
how do i make something that finds if the word from the given list is inside the user input, and by that i mean that the user input for 'hi' can be 'hi dude' and it doesn't has to be only 'hi'
This problem had bothered me for too long...
Thank you in advance
My main problem is-
how do i make something that finds if the word from the given list is inside the user input, and by that i mean that the user input for 'hi' can be 'hi dude' and it doesn't has to be only 'hi'
Code:
import random
from time import sleep
hi='hi','HI','Hi','hI'
hello='hello','Hello','HELLO'
howdy='howdy','Howdy','HOWDY','HowDy'
while 1:
X=raw_input(random.choice(anything))
if hi in X :
print "<!--I'm A Comment-->"
print random.choice(hello)
break
elif X in hello:
print "<!--I'm A different Comment-->"
print random.choice(hi)
break
elif X in howdy:
print '<!--I am something completely different-->'
elif X in curses:
print random.choice(anticurse)
sleep(0.5)
Thank you in advance
Comment