It run as expected here: Python 3.6. On 2.7 runs also.
sinstance(object, type or type tuple)
In your case isinstance(num, (int, float)) will return what you want
Repost your code in code tags so we can see the proper indentation
sinstance(object, type or type tuple)
In your case isinstance(num, (int, float)) will return what you want
Repost your code in code tags so we can see the proper indentation