What do you think about this?

>>> trans = [{'debit':'50.6'},{'debit':'20.2'}]

>>> for row in trans:

row['debit'] = float(row['debit'])


>>> trans

[{'debit': 50.600000000000001}, {'debit': 20.199999999999999}]

I Just want to convert some string to float but I get these weird numbers. Is it a bug in Python or am I doing something wrong?
If you take it down to the "onesandzeros" where floating point numbers (and every thing else) must eventually be represented, you'll find that there is no way to store 20.2 precisely. Given the number of bits available, that's a pretty good approximation, though. Going the other way (float to text) is handled correctly:

>>> a = 20.2

>>> a

20.199999999999999

>>> "%.2f" %a

'20.20'

>>>