I have a python script and I am receiving the following error. I'm a new learner to this language, so I created a simple script, called writing.py, to write participant names and scores into a text file named scores.txt. But I keep getting this error:
Traceback (most recent call last):
File "writing.py", line 4, in <module>
participant = input("Participant name > ")
File "<string>", line 1, in <module>
NameError: name 'Helen' is not defined
Here is my code:
f = open("scores.txt", "w")
while True:
participant = input("Participant name > ")
if participant == "quit":
print("Quitting...")
break
score = input("Score for " + participant + "> ")
f.write(participant + "," + score + "\n")
f.close()