I am building a basic calculator using python and I have a feature that will detect if the text entered is a number or not. For that I have defined a function ie
def check_num(num):
while not num.isnumeric():
print("Invalid number! Please enter a valid number.")
num = input()
When I take an input of the number it is taking just the first input.
num1 = input()
check_num(num1)
How do I make it take the correct input that is the last input?
Here is an image of the code running in command prompt: