Checking if a non-decimal number is a decimal number


#1



https://www.codecademy.com/courses/python-intermediate-en-rCQKw/0/3?curriculum_id=4f89dab3d788890003000096


i expected the code to work but I'm not sure how to round the number back down


def is_int(x):
    y=round(x)
    if(y-x=0):
        return True
    else:
        return False


#2

Oh, you are using assing operator in the if statement.

Use "==" instead of "="


#3

maybe but it didn't solve the problem


#4

What error does it output now? Please show us what you have now.


#5

sorry i confused with another exercise... but i need help with something else


#6

Best to create another discussion with your code and problem :slight_smile:


#7

yeah i know just thought it was the same code for a moment


#8

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