Hi try to do a program that asks the user for a number and only allow an int between 0-100 If not, i want to ask the same question agian. EDIT I try to do a program that asks a user for a number then the user have to type a nuber between 0 - 100 if not question i asked agin. If the user type a sting it will generates a other message and then ask the user to enter a number between 0 -100. if the nuber is correct i want to break out of the loop. EDIT2 Problem solved! Thanx for quick help from every one. I am a noob on this...
print('Whats your name?')
name = input()
print('Hello ' + name + ' enter a number between 0 - 100')
number = input()
while True:
try:
if 0 <= int(number) <= 100:
print('Good')
break
else:
print('You must enter a nuber between 0 - 100')
continue
except ValueError:
print('You must enter a nuber between 0 - 100')