What is the error in this code?


#1

This code is to check whether the given number is Integer or not?
def is_int(x):
if type(x) == int:
return "True"
else:
return "False"


#2

for this challenge, -2, -2.0 and 7.0 should also be considered integers, something type doesn't consider as integer, otherwise it wouldn't be a challenge

Also, you should return Boolean values (True, False), not strings if the x is a integer


#3

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