floating point arithmetic error overflow
Solution[in]: a = 1.1
b = 2.2
a + b
[out]: 3.3000000000000003
Use the decimal module provided by Python to convert floating-point numbers to strings first, and then perform operations
from decimal import Decimal a = Decimal('1.1') b = Decimal('2.2') a + b>>>Decimal('3.3')