you can have a list of names that you want to name objects, and then in a loop you add names to the global namespace when creating and object names.
list_of_names = ['a', 'b', 'c', 'd']
for name in list_of_names:
globals()[name] = your_object()
People here will definitely say that this is a bad way to code without any compelling reason, but it will directly solve your problem without any further lists or dict.
cobie source
share