你在粗体部分遇到的第一个问题是由于非缩进块造成的,在那里添加一个缩进。第二个问题是未定义 name 变量。以下是更正后的版本:print ("Come-on in. Need help with any bags?") bag=input ('(1) Yes please (2) Nah, thanks (3) Ill get em later TYPE THE NUMBER ONLY') if bag == ('1'): print ("Ok, ill be right there!") if bag == ('2'): print ("Okee, see ya inside. Heh, how rude of me? I'm Daniel by the way, ya?") name="Daniel" print (name + ": Um, Names " + name) print ("Dan: K, nice too ... 阅读更多