Is there a way to create multiple lists with names from elements of another list.
Eg:
names=["Rob","Mark","Steve"]
Is there a way to create lists like:
Rob=[]
Mark=[]
Steve=[]
Is there a way to create multiple lists with names from elements of another list.
Eg:
names=["Rob","Mark","Steve"]
Is there a way to create lists like:
Rob=[]
Mark=[]
Steve=[]
The one obvious way is like this:
>>> names = ["Rob","Mark","Steve"]
>>> lists = {name: [] for name in names}
>>> print lists
{'Steve': [], 'Rob': [], 'Mark': []}