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 (65) [earned 5 cycles]
View Answer
ArchieMaclean (613)

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 :)