I'm currently making a game with a scoreboard that requires the user's name. If I were to make a programme that asks for the user's name, and if it is >20 chars, it would loop back and ask again
name_list = []
name = input('Please enter your name (not more than 20 chars): ')
while len(name) > 20:
name = input('Please enter your name (not more than 20 chars): ')
if len(name) <= 20:
name_list.append(name)
I'm wondering if there is a simpler way to do this