To compare floating point values, in Python 3.5 and later you might also want to consider math.isclose, in which you can also plug an epsilon for absolute tolerance if necessary.