infinity symbol in python code example
Example 1: infinity in python
# Defining a positive infinite integer
positive_infnity = float('inf')
print('Positive Infinity: ', positive_infnity)
# Defining a negative infinite integer
negative_infnity = float('-inf')
print('Negative Infinity: ', negative_infnity)
Example 2: infinity in python
# Simple piece of code that runs forever or until you CTRL-C
while true:
num = 0
print(num)
num += 1