0

How do i assign an owner to his/her pets?

Both lists are lists of objects, owner list with attributes name, lastname, and petlist with attributes typeofpet,name, gender and age. Parent=[[ā€Saraā€, ā€Johnsonā€],[ā€Hectorā€, ā€Rodriguezā€]] Pets=[[ā€catā€, ā€catnameā€, ā€maleā€, 2],[ā€birdā€, ā€birdnameā€, ā€femaleā€, 3]] How do i for example give sara both of the pets?

25th Mar 2022, 8:58 PM
Lenoname
1 Answer
+ 1
Use a dictionary.
25th Mar 2022, 9:29 PM
Simon Sauter
Simon Sauter - avatar