0

I'm learning the basics of Python, and I have the following error:

Exception appeared : NameError
name 'my_input_value' is not defined
  File "C:\Users\(...)\t.py", line 9, in init_player
    username = str(input("What's your username?\n"))
  File "C:\Users\(...)\t.py", line 15, in <module>
    t = init_player()

What does it happen? Thanks for your help.

Code:

# -*-coding:Latin-1 -*

def init_player():
    '''
    This function asks for the name to the user, and gives back its name.
    '''
    check = False
    while check == False:
        username = str(input("What's your username?\n"))
        if len(username) > 0:
            check = True

    return str(username)

t = init_player()
Fred
  • 173
  • 1
  • 3
  • 14

0 Answers0