samedi 16 juillet 2016

How can I output a dictionary in a class?


So I got a class like this:

class Useraccount():

def __init__(self, saving, checking, PIN):
    self.save = saving
    self.check = checking
    self.passwd = PIN

I want a output like this:

>>> a = Useraccount(2000,3000,1234)
>>> a
>>> {1234:[2000,3000]}

How to achieve this, please help me out.


Aucun commentaire:

Enregistrer un commentaire