What is the error in this code?


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


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


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