I am writing a program in python that will calculate a students GPA. Within the program, I have an input statement which asks the user to enter their student id. Although, the student id entered must be 5 digits in length, or else the program will loop and ask the user to enter the proper number of digits for their id number again. Where I am confused is to how you can check if the input for the integer is within a certain length or number of spaces, in my case its a 5 digit student id
here is my code within the program, the while loop I have below is incorrect because it is only checking if the id number is greater than the integer 5, but not 5 digits. Any type of clarification would be appreciated, thanks
Validates Id Range
id_number = int(input(" Student ID: "))
while id_number < 5:
id_number = int(input(" try again with Student ID: "))