Run
import math x = math.nan result = math.isfinite(x) print('isfinite(x) :', result)
Output