Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. class Expense:
  2.  
  3. def __init__(self,paidBils):
  4. self.income=70000
  5. self.paidBills=paidBils
  6. self.spent=self.income-self.paidBills
  7. self.remains=self.income-self.spent
  8.  
  9.  
  10. class Bill(Expense):
  11. amountPaid=0
  12. def __init__(self):
  13. pass
  14. def Electric(self,isPaid):
  15. if (isPaid):
  16. self.amountPaid+=1000
  17. Expense.__init__(self,self.amountPaid)
  18. def Water(self,isPaid):
  19. if (isPaid):
  20. self.amountPaid+=3000
  21. Expense.__init__(self,self.amountPaid)
  22. def Telivision(self,isPaid):
  23. if (isPaid):
  24. self.amountPaid+=600
  25. Expense.__init__(self,self.amountPaid)
  26. def SpentExpense(self):
  27. print(self.spent)
  28. def RExpense(self):
  29. print(self.remains)
  30.  
  31.  
  32. A=Bill()
  33.  
  34. A.Electric(True)
  35. A.Water(True)
  36. A.RExpense()
  37. A.spent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement