私が取り組んでいる単純なコードに問題がありました。それはあなたの名前とあなたの一日がどうだったかを尋ね、あなたの答えに応じて、その答えにリンクされたアクションを実行する必要があります. 事前にご協力いただきありがとうございます。
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?"