Ok, so I built a a function to accept only numeric inputs. I am new to python. Basically I am getting an error when I try writing a non-numeric input and then write a numeric input. This is my code
class TestNumericInput:
def numeric_input(self):
val = str(input())
if val.isdigit():
val_number = int(val)
return val_number
else:
print('Please write only numbers (i.e. 0, 1, 2...)')
self.numeric_input()
def start(self):
my_number = self.numeric_input()
print(my_number * 5)
This is a screenshot of the error I am getting
Thanks
return self.numeric_input().