It\'s well known that comparing floats for equality is a little fiddly due to rounding and precision issues.
For example: https://randomascii.wordpress.com/2012/02/2
In terms of absolute error, you can just check
if abs(a - b) <= error: print("Almost equal")
Some information of why float act weird in Python https://youtu.be/v4HhvoNLILk?t=1129
You can also use math.isclose for relative errors