python NaN type code example Example: python3 is nan >>> import math >>> x = float('nan') >>> math.isnan(x) True