Advertisement
lubattillah

counts and for loop

May 15th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. """
  2. It is possible to keep a running total of
  3. household monthly spending and display both monthly and annual household spending.
  4. """
  5. monthly_expenses=[12000,15000,45000,32000,18000,37000,45000,20000,33000,21000,17000,60000]
  6. months=["January","February","March","April","May","June","July","August","September","October","November","December"]
  7. annual_expenditure=0
  8. index = 0
  9. for expenses in monthly_expenses:
  10. print("Our household expenditure for",months[index],"was equal to:",expenses)
  11. annual_expenditure+=monthly_expenses[index]
  12. index+=1
  13. print("Our family annual spending by the end of 2018 was:",annual_expenditure)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement