Hello everybody I have been trying to get around the problem of checking for a tuple in raw input and I just got a tip that kind of works but it only works for the second for loop. In other words when you input and of the 'close' words python returns 'thanx for chattin' like it should but if you input any of the 'bad' words it dosnt return anything. I have no idea what the problem is so any help would be much appreciated.
Thank you.
PS I dont know why ,my postings will never indent properly but i think i have them all right.
[CODE=python]
print 'hello'
def loop():
bit=0
bad=('lol','law l','teehee','ro fl','lmao','lmf ao')
close=('close', 'goodbye','shut up','be quiet')
response=raw_in put()
for word in bad:
if word in response:
bit=1
if bit:
print 'we dont use that language here'
else:
print 'i dont understand your gibberish'
break
break
for word2 in close:
if word2 in response:
bit=1
if bit:
print 'thanx for chattin'
else:
print 'i dont understand your gibberish'
break
loop ()
loop ()[/CODE]
Thank you.
PS I dont know why ,my postings will never indent properly but i think i have them all right.
[CODE=python]
print 'hello'
def loop():
bit=0
bad=('lol','law l','teehee','ro fl','lmao','lmf ao')
close=('close', 'goodbye','shut up','be quiet')
response=raw_in put()
for word in bad:
if word in response:
bit=1
if bit:
print 'we dont use that language here'
else:
print 'i dont understand your gibberish'
break
break
for word2 in close:
if word2 in response:
bit=1
if bit:
print 'thanx for chattin'
else:
print 'i dont understand your gibberish'
break
loop ()
loop ()[/CODE]
Comment