Advertisement
Spocoman

06. Bills

Dec 26th, 2021
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. month = int(input())
  2. electricity = 0
  3. water = month * 20
  4. internet = month * 15
  5. other = 0
  6.  
  7. for i in range(0, month):
  8.     current_bill = float(input())
  9.     electricity += current_bill
  10.     other += (current_bill + 35) * 1.2
  11.  
  12. average = (electricity + water + internet + other) / month
  13. print(f'Electricity: {electricity:.2f} lv')
  14. print(f'Water: {water:.2f} lv')
  15. print(f'Internet: {internet:.2f} lv')
  16. print(f'Other: {other:.2f} lv')
  17. print(f'Average: {average:.2f} lv')
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement