My users will be creating an arbitrary number of Human objects and grouping them in as many groups as they like. (The number of groups created will be tracked) I want to create a list for each group that they've created to use later. How can I create a list for each group if I don't know how many groups there will be?
I've thought of something like the following:
for i in range(num_groups): eval('group_' + str(i) + ' = ')
which should create an empty list for group i named group_i. I've read that eval is not something that should be used in most cases, so I'm wondering if there's a better way.