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 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
Based on the image provided youre asked to write a recursive function named pricehunt that navigates ... View full answer
Get step-by-step solutions from verified subject matter experts
