-infinity 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: python infinity

test = float("inf")

Example 3: or in python

# Syntax for Boolean expression with or in Python
exp1 or exp2

Example 4: infinity in python

# Simple piece of code that runs forever or until you CTRL-C
while true:
    num = 0
    print(num)
    num += 1