Is_int


#1

Hi

I have this code:

from math import floor

def is_int(x):
  if floor(x) == x:
    return True
  else:
    return False
    
  is_int(5.5)

Why is my code not working?

This is the excercise:
https://www.codecademy.com/courses/learn-python/lessons/practice-makes-perfect/exercises/isint?action=resume_content_item&fbclid=IwAR1FA3_8eb53BZtnNCmUsn6y-TuYWe70StIqxCkQFUE7Gh9iv6AuhTd4Yp0


#2

define not working? There is no output, because you put the function call inside of the function body


#3

Thanks, i fixed it. There is stil no output in the terminal.


#4

you still need to print the returned result, by putting a print statement before the function call


#5

Aha thanks. Can’t believe it was that easy.