Practice Makes Perfect, is_int



is this bug or did I do the task perfectly.

3rd lesson --> is_int (please read the task first. )

define a function for int(), i do this:

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

when i hit ‘Run’ , he said my job was correct. but when I reset the task and asked for a solution, I got this:

def is_int(x):
  absolute = abs(x)
  rounded = round(absolute)
  return absolute - rounded == 0

Is this a bug when it showed me that is true, but is not it really true?


There can be multiple ways to solve the problem, yours is correct as well.


oooooouuuu yea :smiley: I’m a genius lol :rofl:


@stetim94 i also do the same and the same problem occurs , whats the reason behind this?


you violated the guidelines by hijacking an existing topic rather then creating your own topic.

same problem is referring to something non-existing, pax37 just wanted conformation his solution was also correct. You provide no code and no error message, so impossible to say what you problem is


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