Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from compte_simple import CompteSimple
- class Banque:
- '''TODO'''
- def __init__(self):
- self.comptes = []
- def ouverture_compte(self, titulaire, depot_initial):
- compte = CompteSimple(titulaire, depot_initial)
- self.comptes.append(compte)
- return compte
- def total_compte(self):
- somme_comptes = 0
- for compte in self.comptes:
- somme_comptes += compte.solde
- return somme_comptes
- def prelevement_frais(self, pourcentage_frais):
- for compte in self.comptes:
- frais = (compte.solde * pourcentage_frais)
- compte.solde -= frais
- def __repr__(self):
- return repr(f"banque : {self.comptes}")
- def __str__(self):
- return f"comptes : {self.comptes}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement