0

I am wondering how to limit characters when inputting a name in a while loop.

This is what I have written so far.

user_name = input("What is your name? ")  # User inputs name
if len(user_name) > 35:
    print("Please enter a name under 36 characters.")
if len(user_name) < 1:
    print("Please enter a name")

print(user_name)  # testing if program is working so far

I want put this all into a while loop but I'm not sure how and if the user inputs a name that follows all of the length rules to run another command.

I know this is a simple question but I'm not the best with python and need to write a simple script.

0 Answers0