I can check integer with isdigit() or isnumeric(), but they don't work for float.
    variable = input("Enter anything: \n")
    #entered a float number: 3.1
    print(variable.isdigit()) #returns false
    
    if variable.isnumeric() and variable.find('.')==-1: #isnumeric also returns false
        variable = int(variable)
    elif variable.isnumeric() and variable.find('.')>=0:
        variable = float(variable)
    
    print("is it a string? : ")
    print(isinstance(variable, str)) #TRUE
    print("is it an integer? : ")
    print(isinstance(variable, int)) #false
    print("Is it a float number? : ")
    print(isinstance(variable, float)) #FALSE
