This is a recurring question. This rounding "problem" occurs by the way the fluent point number is stored and manipulated in the CPU itself, and does not depend on Python. The processor works with binary floating point and not decimal, so there are these small inaccuracies. The languages end up by table incorporating this.
It's very fast to work with numbers like that and they work well in many scenarios. When you want accuracy, probably because you're working with monetary values, you need to use a decimal type or something similar that guarantees the necessary precision.
What you can do in Python or any language is to display the number with the number of decimal places you want. Most of the time you will get the number you want. Not at all.
In this answer in SO there are some alternatives to the presentation:
>>> a=13.946
>>> print(a)
13.946
>>> print("%.2f" % a)
13.95
>>> round(a,2)
13.949999999999999
>>> print("%.2f" % round(a,2))
13.95
>>> print("{0:.2f}".format(a))
13.95
>>> print("{0:.2f}".format(round(a,2)))
13.95
>>> print("{0:.15f}".format(round(a,2)))
13.949999999999999
Formatting Documentation .