This is not valid verification of the number type:
You can write down and use some function for a number like strings validation:
gender is int() or float()And the hidden problem is that you get your variables as a strings (with the input() function). So the similar valid verification wouldn't succeed anyway.
You can write down and use some function for a number like strings validation:
def is_string_number(string: str) -> bool: # It validates integers as well as floats try: # It tries to cast the string to the float float(string) # It it succeed it returns True return True except ValueError: # If it failed it returns False return False