Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ContoCorrente:
- def __init__(self, nome, conto, importo):
- self.nome = nome
- self.conto = conto
- self.saldo = importo
- def preleva(self, importo):
- self.saldo -= importo
- def deposita(self, importo):
- self.saldo += importo
- def descrizione(self):
- print(self.nome, self.conto, self.saldo)
- c1 = ContoCorrente("Pietro", "10", 2000)
- c2 = ContoCorrente("Stefano", "20", 3000)
- c3 = ContoCorrente("Annibale", "30", 7000)
- c1.descrizione()
- c2.descrizione()
- c3.descrizione()
- c1.deposita(333)
- c1.descrizione()
- c2.preleva(200)
- c2.descrizione()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement