python program that allows a user to track spending in three categories per month and return thehighest spending among all the months. The three categories are: rent, grocery, and utilities. Adictionary spend_dict, provided in the template file, holds the monthly expenditure for categories.spend_dict contains the name of month as key and value is a list of expenditure in three categories. Forexample: user spent $90 in grocery category in the month of January.spend_dict = {'Jan': [90,60, 50], 'Feb': [56, 30, 65], 'Mar': [100, 85, 78]}For this pyhton program, i want to find the user’s maximum expenditure from the given months.Lab Scenario:The template file contains a dictionary as described above. You need to define the following functionsas below:
Extracted text: Function name Description parameter Return type main() Handles the main None None functionality of the code. provided Structure in template file Calculates summation of monthly_spending () spend_dict dict total spending per month and populates dictionary a new called month_spend_dict where, each key is the name of the month and the value is the summation of total spending per month. This function returns the new dictionary. You can use sum function for this purpose. max_spending() Finds the maximum month_spend_dict string, int spending of the user from month_spend_dict dictionary. This function returns the month with highest spending and the amount spent on that month.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here