PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
# float value of infinity
pos_inf = float('inf')
neg_inf = float('-inf')
print(pos_inf, neg_inf)
# symbolic value of infinity
from sympy import oo
sym_pos_inf = oo
sym_neg_inf = -oo
print(sym_pos_inf, sym_neg_inf)
OUTPUT
Run