Advertisement
simeonshopov

Month bills

Oct 17th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. months = int(input())
  2. water = 0
  3. internet = 0
  4. elec_total = 0
  5. other_total = 0
  6. total = 0
  7.  
  8. for i in range(months):
  9.   elec_bill = float(input())
  10.   other = (elec_bill + 20 + 15) * 1.2
  11.   other_total += other
  12.   water += 20
  13.   internet += 15
  14.   elec_total += elec_bill
  15.  
  16. total += other_total + internet + water + elec_total
  17.  
  18. print(f"Electricity: {elec_total:.2f} lv")
  19. print(f"Water: {water:.2f} lv")
  20. print(f"Internet: {internet:.2f} lv")
  21. print(f"Other: {other_total:.2f} lv")
  22. print(f"Average: {(total / months):.2f} lv")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement