What do you think about my solution?


import math

def is_int(x):
    return math.floor(x) == x

What do you think?


Clever, but wasteful. There is no need to populate the namespace with the math module. % is built in.

return x % 1 == 0


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