I have just started OOPs in python and came across this piece of code . I was trying to understand the code in https://pythontutor.com/render.html#mode=display but could not understand the output of first if statement , if float value is passed(like the code). Secondly , during visualizing the code in the mentioned link , third statement is skipped , cannot understand why ? It will really be helpful if someone , can that I am unable to understand .
class CheckValue:
@staticmethod
def is_integer(num):
if isinstance(num, float):
return num.is_integer()
elif isinstance(num, int):
return True
else:
return False
val = CheckValue.is_integer(10.5)
print(val)