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
1
TimothyAnderso1 (55)

Makin it simple again cause i can lmao

x = input() ## Asks for user input
has4digits = false ## Lets you know if you got 4 digits

for char in x: ## For Every character in x
   num = num + 1 ## Num = num + 1
   if num >= 4:
       has4digits = true


if has4digits = true:
    print(" :D I have 4 digits! ")