Im stuck :(


#1

def is_int(x):
if round(x)-x==0:
return true
else:
return false

INSTRUCTIONS:
.
Define a function is_int that takes a number x as an input.

Have it return True if the number is an integer (as defined above) and False otherwise.

ERROR TYPE:
Did you create a function called is_int? Your code threw a “global name ‘true’ is not defined” error.


#2

Recall that in Python, the boolean primitives are True and False.

The reverse would make more sense (to me, anyway)…

if x - round(x) == 0:

#3

def is_int(x):
if x-round(x) == 0:
return true
else:
return false

IT DOESN´T WORK :frowning:


#4
return True

return False

#8