Overview:
- The function isfinite() checks whether the parameter passed in is infinite or not and returns a Boolean result.
Example:
# Example Python program that checks # Is a positive integer finite? # Is a negative integer finite? # Check pi is finite or infinite # Check with infinity # Check with NaN |
Output:
A positive integer is finite:True A negative integer is finite:True Pi is finite:True Infinity is finite:False NaN is finite:False |