How can I create multiple variables from a list of strings? [duplicate]

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!

Leave a Comment