Hello! Even though I haven't introduced myself yet, I'm CurtainCrab. So, I was making a quick program to organise tournaments on Python. I had just started, and when I made a few tests to check, I encountered a problem that I couldn't find the solution to on the internet, so I thought I'd ask you.
# Program to organize a tournament # A few variables players = list() playercount = (int(input("Amount of players : "))) name = "" # A loop that will assign a name to each player in the list (players) looper = (playercount) while looper != 0: name = str(input("name of a player : ")) players.append(name) looper = looper - 1
And so, I tried the code above, and everything seemed to work well until I entered the Line 14 (name) and it gave me the following error message :
[background=#262626] [/background]Traceback (most recent call last): File "/Users/delmasfamily/Desktop/tournament.py", line 14, in <module> name = str(input("name : ")) File "<string>", line 1, in <module> NameError: name 'john' is not defined
Thanks a lot for your time everybody! Have a good day and I'll see you later.
Edited by CurtainCrab, 30 October 2017 - 10:56 PM.