Advertisement
banovski

Adding VAT

May 31st, 2022
930
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. class Article:
  2.     def __init__(self, base_price, quantity):
  3.         self.base_price = base_price
  4.         self.quantity = quantity
  5.  
  6.     def add_vat(self, current_vat_as_float):
  7.         return self.base_price * (1 + current_vat_as_float)
  8.  
  9. item_one = Article(1000.00, 100)
  10.  
  11. print("Total:", item_one.add_vat(0.2))
  12.  
  13. # Total: 1200.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement