name = raw_input("What is your name? ")
quest = raw_input("What quest do you chose?, 1 for slaying a dragon, 2 for defeating the evil wizard and 3 for killing the kraken ")
if quest == 1
quest == "so you want to slay a dragon."
elif quest == 2
quest == "do you have something against wizards, relax im joking"
elif quest = 3
quest == "have you got a boat, better jet a submarine?"
else quest = "so you have no quest, hm... in that case GET OUT OF MY SWAMP"
print quest
它一直给我这个错误:
文件“ python”,第3行 如果任务== 1 ^ SyntaxError:语法无效
答案 0 :(得分:0)
name = raw_input("What is your name? ")
quest = raw_input("What quest do you chose?, 1 for slaying a dragon, 2 for defeating
the evil wizard and 3 for killing the kraken\n")
if quest == "1":
quest = "so you want to slay a dragon."
elif quest == "2":
quest = "do you have something against wizards, relax im joking"
elif quest == "3":
quest = "have you got a boat, better jet a submarine?"
else:
quest = "so you have no quest, hm... in that case GET OUT OF MY SWAMP"
print(quest)
如果这有助于您将其标记为问题的答案!