Question: Write a recursive function named price_hunt. Given such nested dictionary, you should be able to have this function find and return all the values

Write a recursive function named price_hunt. Given such nested dictionary, you should be able to have this 

Write a recursive function named price_hunt. Given such nested dictionary, you should be able to have this function find and return all the values associated with the key string 'price' (i.e. whether its price or price two or price low, etc). Find the total sum (i.e. sum all the values corresponding to the string 'price'). data = { } 'price one': 1, 'item': 'house', 'parts': { 'kitchen': { }, 'bedroom-1': { }, 'price': 1, }, 'price low': 1, 'master-bedroom': { 'price high': 2, 'bathroom': { 'price': 1 } Activate Wine

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Based on the image provided youre asked to write a recursive function named pricehunt that navigates ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!