def setof Names (profiles, location): Specific Restrictions (in addition to the general restrictions above): You are only allowed set(), .items(), .values(), .keys(), .add(), .get() o You should only use sets and dictionaries Description: profiles is a dictionary keeping track of the dating app members. The dictionary key is a profile ID, and the value is a list containing: member name, phone number and location. location is a string containing some location search value. This function returns a set containing the member's names who live in the search value location. Parameters: profiles is a dictionary of variable size that contains profile ID (string) as key and the member's name (string), phone number (string) and location (string) (in list format) as value. location is a string. Return value: a set containing the names of the members (string). Note that this function does return something! Assumptions: All input values are valid. The order of the list values in the dictionary is: member name first, followed by phone number and then location. Examples: profiles = { "B111": ["Anahi Saunders", "502-223-221", "Fair"], "B222": ["Thaddeus Huff", "501-121-1123", "Washington "], "B333": ["Deven Holden", "123-323-3463", "Vien"], "B444": ["Cale Day", "501-56-5321", "Cha"], "B555":["Kenley Hartman", "231-331-34", "Alex"], "B666":["Giovanni Ruiz", "123-258-1251", "Alex"], "B777": ["Kamari Knox", "224-127-2762", "Washington "], "B888": ["Kael Barr", 321-124-3312", "Washington "], "B999": ["Catalina Colon", "711-256-8456", "Fair"], "B010":["Jasiah Fritz", "513-212-1252", "Fair"] } setofNames(profiles, "Fair") setofNames(profiles, "Washington") setofNames(profiles, "Cha") {"Catalina Colon', 'Anahi Saunders', 'Jasiah Fritz"} {"Kael Barr', 'Thaddeus Huff", "Kamari Knox"} {'Cale Day'} Explanation: We first create a new set; as we loop through the dictionary looking for all location matches to the passed-in search value; every time there is a match found, we take the name from that dictionary value and add it to the set. When we have looked through the entire dictionary, we return the populated set.
def setof Names (profiles, location): Specific Restrictions (in addition to the general restrictions above): You are only allowed set(), .items(), .values(), .keys(), .add(), .get() o You should only use sets and dictionaries Description: profiles is a dictionary keeping track of the dating app members. The dictionary key is a profile ID, and the value is a list containing: member name, phone number and location. location is a string containing some location search value. This function returns a set containing the member's names who live in the search value location. Parameters: profiles is a dictionary of variable size that contains profile ID (string) as key and the member's name (string), phone number (string) and location (string) (in list format) as value. location is a string. Return value: a set containing the names of the members (string). Note that this function does return something! Assumptions: All input values are valid. The order of the list values in the dictionary is: member name first, followed by phone number and then location. Examples: profiles = { "B111": ["Anahi Saunders", "502-223-221", "Fair"], "B222": ["Thaddeus Huff", "501-121-1123", "Washington "], "B333": ["Deven Holden", "123-323-3463", "Vien"], "B444": ["Cale Day", "501-56-5321", "Cha"], "B555":["Kenley Hartman", "231-331-34", "Alex"], "B666":["Giovanni Ruiz", "123-258-1251", "Alex"], "B777": ["Kamari Knox", "224-127-2762", "Washington "], "B888": ["Kael Barr", 321-124-3312", "Washington "], "B999": ["Catalina Colon", "711-256-8456", "Fair"], "B010":["Jasiah Fritz", "513-212-1252", "Fair"] } setofNames(profiles, "Fair") setofNames(profiles, "Washington") setofNames(profiles, "Cha") {"Catalina Colon', 'Anahi Saunders', 'Jasiah Fritz"} {"Kael Barr', 'Thaddeus Huff", "Kamari Knox"} {'Cale Day'} Explanation: We first create a new set; as we loop through the dictionary looking for all location matches to the passed-in search value; every time there is a match found, we take the name from that dictionary value and add it to the set. When we have looked through the entire dictionary, we return the populated set.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
in python please
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 3 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
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education