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