For example, if I have this code. How would I get it to add all the objects together?
class saved_money():
def set_amount(self, amt):
self.amount = amt
return "$"+(format(self.amount, '.2f'))+""
After running the code, I would type something like this in the Python Shell:
a = saved_money()
a = set_amount(100)
There could be any amount of objects and I want to know if there is a way I could add them all together.