What do you think about my solution?


#1

import math

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

What do you think?


#2

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

return x % 1 == 0

#3

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