float('inf') python code example Example 1: float inf in python float('inf') float('-inf') Example 2: float infinity python a = float('inf')