我一直在处理我正在处理的简单代码时遇到问题。它会询问您的姓名,以及您今天过得怎么样,并且根据您的回答,它应该执行与该回答相关联的操作。感谢您提前提供的所有帮助。
import time
print "Hello."
time.sleep(.5)
print "What's your name?"
var = raw_input()
time.sleep(.3)
print "Hello", var
time.sleep(1)
print "How are you?"
i = 0
answer1 = False
answer2 = False
answer0 = False
repeat = True
while repeat == True:
if i == 0:
answer = raw_input()
if answer == "Good" or "good":
answer1 = True
if answer == "Bad" or "bad":
answer2 = True
if answer is not "good" or "Good" or "ok" or "Ok" or "OK" or "Not so good" or "not so good" or "Not so good." or "not so good.":
answer0 = True
if answer2 == True:
print "That sucks."
time.sleep(1)
print "Well that's end of my code", var
time.sleep(1)
print "See ya!"
break
if answer1 == True:
print "That's awesome!"
time.sleep(1)
print "Well that's end of my code", var
time.sleep(1)
print "See ya!"
break
if answer0 == True:
print "I'm sorry, I didn't understand you."
time.sleep(1.5)
print "Are you good, ok, or not so good?"