3. lookup_friends_heights This function takes a friends database (a list of dictionaries, like the previous functions) and a list of friends names, and it returns a list of heights for the specified friends. If a given friend's name is not present in the friends database, we put a None in the corresponding slot. We assume that there will be at most one friend with a given name in the list. You may want to use nested for-loops for this function. Sample calls should look like this. >>> lookup_friends heights([{"name": "todd", "height":170},{"name":"sarah", "height":165},{"name": "dweezil", "height":175}], ["dweezil", "sarah"]) [175, 165] >>> lookup_friends_heights([{"name":"todd", "height" :170),("name":"sarah", "height":165},{"name": "dweezil", "height":175}], ["sarah", "eliza", "dweezil"]) [165, None, 175]
3. lookup_friends_heights This function takes a friends database (a list of dictionaries, like the previous functions) and a list of friends names, and it returns a list of heights for the specified friends. If a given friend's name is not present in the friends database, we put a None in the corresponding slot. We assume that there will be at most one friend with a given name in the list. You may want to use nested for-loops for this function. Sample calls should look like this. >>> lookup_friends heights([{"name": "todd", "height":170},{"name":"sarah", "height":165},{"name": "dweezil", "height":175}], ["dweezil", "sarah"]) [175, 165] >>> lookup_friends_heights([{"name":"todd", "height" :170),("name":"sarah", "height":165},{"name": "dweezil", "height":175}], ["sarah", "eliza", "dweezil"]) [165, None, 175]
Chapter3: Performing Calculations With Formulas And Functions
Section: Chapter Questions
Problem 3.15CP
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage