Submitted by: Srinath M S(srinath_ms@yahoo.com)

Friday Apr 10th 2020 by Srinath M S
Article Image

Language: Web, Expertise: Beginner: See how to check whether or not a number is finite in Python.

Use the math module's isfinite method to determine if a value is finite or not. If it is not a number, the function returns false.

See below for an example:

math.isfinite(10) returns True
Mobile Site | Full Site