math.inf (infinity) constant is a floating point value that represents the mathematical concept of infinity

ExampleEdit & Run
#import the math library
import math

#print the value of infinity
print(math.inf)

#print negative infinity
print(-math.inf)
Output:
inf -inf [Finished in 0.010501572862267494s]
Syntax:
math.inf

The value returned is equivalent to float('inf')

ExampleEdit & Run
import math

print(type(math.inf))

print(math.inf == float("inf"))
print(-math.inf == float("-inf"))
Output:
&ltclass 'float'&gt True True [Finished in 0.010168019216507673s]