Question: Task 7 Write a function add _ owners that will match cars with their owners based on a dictionary passed as a parameter. The dictionary
Task
Write a function addowners that will match cars with their owners based on a dictionary passed as a parameter. The dictionary uses owners Person objects as keys and tuples of Car objects they own, as values. You mayshould reuse the previously developed function getaddress to retrieve Persons addresses. Note that this function does not print or return anything, its role is to modify existing objects.
Example usage:
houses
h House Happy St Blackwood'
h House Agnes Av Aldinga'
h House Daw St Aldinga'
h House Oak St Blackwood'
h House Gorge Av Aldinga'
h House Waterman St Aldinga'
c CarFord'Mustang',
c CarFord'Fiesta',
c CarToyota'Camry',
c CarMazdaCx
c CarMazdaCx
c CarMitsubishi'Colt',
c CarToyota'Corolla',
p PersonJim
p PersonAshley
p PersonCleo
p PersonJessica
p PersonAdam
p PersonAndrew
p PersonJake
p PersonJoshua
p PersonAmica
p PersonHelen
p PersonBarney
p PersonSandra
p PersonJohn
p PersonPatrick
p PersonSammy
haddcarcc
haddcarc
haddcarc
haddcarccc
haddcarc
haddcarcc
haddinhabitantpppp
haddinhabitantpp
haddinhabitantppp
haddinhabitantp
haddinhabitantpp
haddinhabitantppp
houses.extendhhhhhh
d p:ccp:ccp:ccc p:c
addownershousesd
printcgetownerslist
printcgetownerslist
printcgetownerslist
output:
Jim Happy St Blackwood'Cleo Happy St Blackwood'
Ashley Happy St Blackwood'
Adam Agnes Av Aldinga'
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
