Running the following
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")
Getting the following error What is the player's name?: 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