Question: Code a function that accepts 1 ) Accept a monthly budget value 2 ) A maximum expense value 3 ) A dictionary of expenses with
Code a function that accepts
Accept a monthly budget value
A maximum expense value
A dictionary of expenses with the folllowing keysvalue pair
key expense name: string value
value expense price: intfloat value
Iterate the dictionary of values and return one of the following values
True & sum of all expenses: if the sum of all expenses is less than or equal to the monthly budget value
False & sum of all expenses: if the sum of all expenses is greater than the monthly budget value
False, the expense name & the expense value of the FIRST expense that is greater than the maximum expense value
NOTE: you are required to add the neccessary paramaters, method body and return statement.
NOTE: error handling is not expected of you, assume that if the values passed will be int, int and dictionary
taskfood: 'fun': 'clothes': 'travel':
True
taskfood: 'books': 'internet': 'streaming services':
False 'internet',
taskfood: 'fun': 'clothes': 'travel': 'books': 'internet': 'streaming services':
False
taskcoat: 'jeans': 'hat': 'scarf': 'boots': 'socks': 'food': 'fun': 'clothes': 'travel':
True
taskcoffee: 'restaurant': 'travel': 'plan ticket': 'school':
False 'restaurant',
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
