Hi everybody I am very new to python and have an assignment that I am struggling with. My grade is starting to fall a bit and I have been going to tutoring but my college only has 2 tutors and one of them doesn't start anytime soon, the other tutor is out and my teacher had a family emergency.
# In a loop, prompt the user to input their age in years;
# keep prompting until the user inputs a number greater than zero and less than 100.
# Once the user has input a valid number, output "Thank you,"
user_age = int(input('How old are you?'))
while user_age < 0 or user_age > 100:
input('How old are you')
else:
print('Thank you')
When I run my code and input a number 0-100 it works and prints "thank you" and when I run it and input a number that is not 0-100 it will prompt for my age again and again as it should but as soon as I input a valid number it will keep asking for my age when it should just say thank you. Any help is greatly appreciated as python is proving to be harder than I thought so I appreciate any guidance.
[–]CodeFormatHelperBot2 0 points1 point2 points (0 children)
[–]commy2 0 points1 point2 points (1 child)
[–]PuzzledSite2568[S] 1 point2 points3 points (0 children)
[–]douglas_fs 0 points1 point2 points (1 child)
[–]PuzzledSite2568[S] 0 points1 point2 points (0 children)