[Solved] How to check if number is string or integer in python using if else [duplicate]


number = input("enter the number \n")

try:
    integer = int(number)

    if integer > 0:
        print "positive", integer
    elif integer < 0:
        print "Negative", integer
    else:
        print "Number is", integer

except ValueError:
    print("Enter integer value")

3

solved How to check if number is string or integer in python using if else [duplicate]