The user here will input a 10 digit long code:
code = input("enter a 10 digit long code")
while len(code) != 10:
code = input("your code wasn't 10 digits long. input it again.")
Now, what would I do to do the same thing but when the user inputs letters instead of numbers? I tried to use int
and ValueError
, as advised by other users when others posted a similar question to this, but I got an error when I ran the code. Thanks