I am running Python 3.6 and Pandas 0.19.2 and want to access the name of a list as follows:
# work on the following two lists
for list in [list1, list2]:
# loop through items in each list
for entry in bucket_set:
# do stuff
# let user know I finished working on list x
print('i just finished working on: '+list)
In the first iteration, this should do stuff and then print out: 'I just finished working on list1'. However: when I run my code, I get the following error:
TypeError: must be str, not list
This makes perfect sense (a list is not a string after all), but is there any way I can get the name of my list as a string ('list1')? I know I can use a dict instead (which is what I'm doing right now), but I'm interested nonetheless.