有人可以帮我修复此Python程序吗?
您在粗体部分遇到的第一个问题是由于非缩进块,请在其中放入一个缩进。
第二个问题是名称变量未定义
以下是更正的-
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 meet ya " + name) if bag == ('3'): print ("Heh, Ya remind me of someone I know... *cough* me *cough*") print ("Oh... Nearly forgot. Names Daniel, Ya?") print (name + ": Eh... " + name) print ("Dan: Cool, I now a" + name)