Feb-07-2020, 12:00 PM
A newbie here
This code prints "too many tires" at every loop.
The goal is to print it at the end of the loop only. (after 3 wrong tries)
Can someone help ?

This code prints "too many tires" at every loop.
The goal is to print it at the end of the loop only. (after 3 wrong tries)
Can someone help ?
x = 1 while x <= 3: name = input("Enter your username: ") if len(name) < 5: print(f"{name} is too short") elif len(name) > 9: print (f"{name} is too long") else: print(f"Welcome {name} !") break x += 1 print("too many tries !")