3
Checking that a user input has four digits
IsobelBolter (2)

how do you check that a user input has four digits?

You are viewing a single comment. View All
Answered by TimothyAnderso1 (55) [earned 5 cycles]
View Answer
1
ArchieMaclean (518)

You can check the length of a string with the len function, e.g.

if len(guess) != 4:
  print("Invalid Input")

Please mark this as the answer if it solved your problem :)