Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Expense:
- def __init__(self,paidBils):
- self.income=70000
- self.paidBills=paidBils
- self.spent=self.income-self.paidBills
- self.remains=self.income-self.spent
- class Bill(Expense):
- amountPaid=0
- def __init__(self):
- pass
- def Electric(self,isPaid):
- if (isPaid):
- self.amountPaid+=1000
- Expense.__init__(self,self.amountPaid)
- def Water(self,isPaid):
- if (isPaid):
- self.amountPaid+=3000
- Expense.__init__(self,self.amountPaid)
- def Telivision(self,isPaid):
- if (isPaid):
- self.amountPaid+=600
- Expense.__init__(self,self.amountPaid)
- def SpentExpense(self):
- print(self.spent)
- def RExpense(self):
- print(self.remains)
- A=Bill()
- A.Electric(True)
- A.Water(True)
- A.RExpense()
- A.spent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement