3. is_int


#1




I am not sure where to start though, how to include integers vs. float but 7.0 is considered a interger when actually is a float?

error: Oops, try again. Your function fails on is_int(-2). It returns False when it should return True.


idk


def is_int(x):
    if x % x != 0:
        return True
    else:
        return False


#2

Hint! If you substract x as an integer from x and it equals 0, x is an integer, right?


#3

I did it this way as well, and i was trying to think of a way to explain it without giving the answer, good answer! :slight_smile:


#4

I dunno if this helps but I i made x == always an integer hint hint "int" , if not then I made it return False


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.