You would do this by creating a dict
:
fruits = {k:[] for k in names}
Then access each by (for eg:) fruits['apple']
– you do not want to go down the road of separate variables!
You would do this by creating a dict
:
fruits = {k:[] for k in names}
Then access each by (for eg:) fruits['apple']
– you do not want to go down the road of separate variables!