Guys how do I make the user enter the answer again for entering less or more characters than required for their full name. for example if a user enters Alex as his full name he should enter his full name again as the amount of characters are too low. ()
Asked
Active
Viewed 43 times
-1
-
Welcome to Stack Overflow. Please include your code. Also, by full name, I'm assuming 'First, Middle and surname'? If so, wouldn't it suffice to check if the entered value has more than one space instead of counting characters? – ewokx Jul 25 '22 at 01:30
-
Please provide enough code so others can better understand or reproduce the problem. – Community Jul 25 '22 at 01:42
-
Does this answer your question? [Asking the user for input until they give a valid response](https://stackoverflow.com/questions/23294658/asking-the-user-for-input-until-they-give-a-valid-response) – Pranav Hosangadi Jul 25 '22 at 16:48
1 Answers
1
while True:
usr_input = str(input("What is your full name? "))
if len(usr_input) <= 3:
print("Please Enter Full Name.")
elif len(usr_input) >= 30:
print("Input string is too long")
else:
pass
# other code goes here
There make sure to delete the pass statement and add your own code

Caleb Bunch
- 109
- 6