#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from money import Money
x = Money(amount='0.01', currency='USD')
words = 'alphabet'
for i in words:
x += 0.01
print (x)
But it just won't run:
Traceback (most recent call last):
File "test.py", line 10, in <module>
x += 0.01
File "C:\Program Files\Python36\lib\site-packages\money\money.py", line 118, in __add__
amount = self._amount + other
TypeError: unsupported operand type(s) for +: 'decimal.Decimal' and 'float'
I have my very easy code:
But it just won't run:
I believe
+=
is the problem. Any way out?