Apr-08-2023, 04:45 PM
(This post was last modified: Apr-08-2023, 04:54 PM by Yoriz.
Edit Reason: Added code tags
)
while True:
year = input('please enter a 4-digit year: ')
digit = len(year)
if digit != 4 and year != int:
print("sorry, that was bad input")
else:
print(f"thanks ! your value is {year}")
breakI want to only except 4 character inputs or display error with the prompt again, which is working but i also need input to be only numeric values. Len wont work on int so im stuck.
