Monthly expenses and savings
In order to make it in New York City, you have decided to split a two-bedroom apartment with a friend. You will have to budget for rent, food and entertainment, but it's also a good idea to allocate an amount for unforeseen expenses each month. This unforeseen expenses budget could be used for anything ranging from new clothes or electronics to doctor appointments.
Set up your monthly budget as follows:
- Rent: $1200 / month (Includes utilities)
- Food: $30 / day (On average. Includes groceries and eating out.)
- Entertainment: $200 / month (Movies, drinks, museums, parties…)
- Unforeseen Expenses: 250 / month (Stay safe, and don't drop your phone!)
For this application, assume an average of 30 days per month. Whatever is left after your paying your monthly expenses will go into your savings account each month.
monthly_takehome_salary
from the previous exercise is available.
This exercise is part of the course
Introduction to Financial Concepts in Python
Exercise instructions
- Calculate your monthly expenses.
- Calculate your monthly savings (what's left after paying your monthly expenses).
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Enter your monthly rent
monthly_rent = ____
# Enter your daily food budget
daily_food_budget = ____
# Calculate your monthly food budget assuming 30 days per month
monthly_food_budget = ____
# Set your monthly entertainment budget
monthly_entertainment_budget = ____
# Allocate funds for unforeseen expenses, just in case
monthly_unforeseen_expenses = ____
# Next, calculate your total monthly expenses
monthly_expenses = ____
print("Monthly expenses: " + str(round(monthly_expenses, 2)))
# Finally, calculate your monthly take-home savings
monthly_savings = monthly_takehome_salary - ____
print("Monthly savings: " + str(round(monthly_savings, 2)))