import math actual=0.1+0.2 print(math.isclose(actual,0.3,rel_tol=1e-9,abs_tol=1e-12))