Guest User

Untitled

a guest
Mar 17th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. class Invoice:
  2.  
  3. def __init__(self, client, total):
  4. self._client = client
  5. self._total = total
  6.  
  7. def formatter(self):
  8. return f'{self._client} owes: ${self._total}'
  9.  
  10. @property
  11. def client(self):
  12. return self._client
  13.  
  14. @client.setter
  15. def client(self, client):
  16. self._client = client
  17.  
  18. @property
  19. def total(self):
  20. return self._total
  21.  
  22. google = Invoice('Google', 100)
  23.  
  24. print(google.client)
  25.  
  26. google.client = 'Yahoo'
  27.  
  28. print(google.client)
Add Comment
Please, Sign In to add comment