I have a Club
class and a Player
Class. The player class has an attribute Fav.clubs
which will have unique club values. So the user is supposed to enter various club names. Based on the club names I must retrieve those club objects and establish the relationship that this particular player has this Fav.clubs
.
The attribute Fav.clubs
in Player
class should store the names of Club
. Now what I have to do is, take input from user about Fav.clubs
(a list). After that traverse each element in the list and access the string name to find the corresponding club object and then store that object instance in Player
class.