Johannes Gijsbers <taradino at softhome.net> writes: > That's not really a good idea, as math.sqrt() returns a float. I'd say: > > >>> import math > >>> def isInt(number): > ... return int(number) == number > ... > >>> isInt(math.sqrt(289)) > 1 > >>> isInt(math.sqrt(315)) > 0 isInt(math.sqrt(1e100)) doesn't work so well.