Name: ______________ Net id: _____________ || Name: ______________ Net id: _____________ Name: ______________ Net id: _____________ || Name: ______________ Net id: _____________
Consider the following example:
["point run score", "point dot", "cut run tear score", "cut valley", "cute pretty"] Returns: [ "cut point run score tear", "cut valley", "cute pretty", "dot point" ]
combine_entries
that simply finds a pair of entries to combine, combines them, and returns True
if such a combination took place, False
otherwise.
Now consider this example:
["ape monkey wrench", "wrench twist strain", "monkey twist frugue strain"] Returns: [ "ape frugue monkey strain twist wrench" ]
while
, loop that calls the function combine_entries
, until all entry pairs have been combined.
Consider the following example:
parents = ["JOE MARY FRANK", "BOB JANE MARTHA", "FRANK MARTHA ROB", "BOB AMANDA TROY"] target = "ROB" Returns: ["TROY"]
parents
.
target
or the name of another child, explain how to get the names of his/her parents.
get_rents
, that returns a list of the names of the parents, either 0 or 2, of the given name.
get_rents
to get all the grandparents of the target name (think about what needs to be initialized before the loop is started as well). With which kind of collection (list, set, or dictionary) would it make the most sense to hold the grandparents?
get_rents
and the collection of grandparents to find all the grandparent's children --- these are the aunts and uncles of the target name.