#sample solution
def run():
smiths = {"father": "Mike", "ex-wife" : "Mary", "children" : ["Bobby", "Susan"] }
jones = {"mother": "Lucy", "ex-husband": "Peter", "children": ["Michelle", "Jeff", "Evan"]}
family = {}
for key in smiths:
family[key] = smiths[key]
for key in jones:
if key == "children":
for child in jones["children"]:
family["children"].append(child)
else:
family[key] = jones[key]
del family["ex-wife"]
del family["ex-husband"]
return family
#check
print run()
No comments:
Post a Comment