May someone assist, i am trying to write a program that evaluate user input. accept three arguments: a prompt, a low acceptable limit, and a high acceptable limit; if the user enters a string that is not an integer value, the function should emit the message Error: wrong input, and ask the user to input the value again; if the user enters a number which falls outside the specified range, the function should emit the message Error: the value is not within permitted range (min..max) and ask the user to input the value again; if the input value is valid, return it as a result. however my code is failing to ask the user to renter the number if they enter number out of range here is my code
class Num_Evaluation:
def __init__(self, prompt, min, max):
self.prompt=prompt
self.min=min
self.max=max
def num_check(self):
while True:
try:
self.prompt=int(input(self.prompt))
assert self.prompt>=self.min and self.prompt<=self.max
print('The number is :', self.prompt)
break
except AssertionError:
print("Number out of range")
except: print("only intiger numbers")
user1=Num_Evaluation("enter number in range -10 to 10: ", -10, 10)
print(user1.num_check())
can anyone assist on how to enable the program to keep asking the user to enter the valid number that is within the requred range