Is_int passing even the output is wrong


#1



https://www.codecademy.com/courses/python-intermediate-en-rCQKw/0/3?curriculum_id=4f89dab3d788890003000096

When i give input as 4 which is an int the output of my code is False and i pass the test.

Am i missing something ?


def is_int(x):
    
    if x == int(x):
        return True
    else:
        return False

print is_int(raw_input())


#2

What are you trying to do here?


#3

calling function is_int as well as passing the argument taken by the user and then printing the output which returns


#4

The return of the raw_input function is a string. So I guess you need to convert it to float first.


#5

try this:

print is_int(float(raw_input("Enter a number:")))