write a function called a rea expendi ture counts data lower spent upper spent which 5345947

Write a function called a rea_expendi ture_counts (data , lower_spent upper_spent) which creates a dictionary of the number of expenditures in the given expenditure amount bracket for each area. That is, each key in the dictionary should be an area name, and the value for that area should be an i nt corresponding to the number of expenditures in the area who fall in the expenditure amount bracket specified by 104 r_spent and upper_spent (inclusive). Your dictionary should have a key for all areas in VALID_AREAS, even the ones that have no expenditures in the expenditure amount bracket. The function should return the top 5 areas by expenditure count as a list of tuples [ (area, expendi ture_count) ]. Top 5 areas should be listed in descending order by count, and ties should be broken by alphabetical order. In this question, you should ignore any nested dictionary with a None value for the area key or the expenditure key. None values for other keys are acceptable. You may assume that lower_spent and upper_spent are positive. If lower_spent > upper_spent, your function Should return a list with a value of 0 for every expenditure.

"Get 15% discount on your first 3 orders with us"
Use the following coupon

Order Now