How to calculate 6*1.2 = 7.2? In Python 6*1.2 = 7.199999999999999

  binary, python

I’m wondering how to write the code so 6*1.2 = 7.2 instead of 7.199999999999999

And why does this happen?

Source: Python Questions

LEAVE A COMMENT