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