How to represent infinity in Python

Infinity represents a value larger than any real or natural number.

Solution for How to represent infinity in Python : You can use float() to represent infinity Call float(x) with x as “inf” or “-inf” to return a floating-point number equal to positive infinity or negative infinity, respectively.


how-to-represent-infinity-in-python