【发布时间】:2013-11-17 03:38:18
【问题描述】:
运行以下
golfFile = open("golf.dat","a")
another = "Y"
while another=="Y":
Name = input("What is the player's name?: ")
Score = input("What is the player's score?: ")
golfFile.write(Name+"\n")
golfFile.write(Score+"\n")
another = input("Do you wish to enter another player? (Y for yes): ")
print()
golfFile.close()
print("Data saved to golf.dat")
出现以下错误 玩家叫什么名字?:j
Traceback (most recent call last):
File "C:\Users\Nancy\Desktop\Calhoun\CIS\Chapter10#6A.py", line 4, in <module>
Name = input("What is the player's name?: ")
File "<string>", line 1, in <module>
NameError: name 'j' is not defined
【问题讨论】:
标签: python