Is it possible to reference a dictionary or list in Python, using a string as it's name when referenced?
for example, would it be possible to make "print(reference[1])" in this code actually work and reference the dictionaries?
sampledict = {1:'valueA',2:'valueB'}
sampledict2 = {1:'valueC',2:'valueD'}
for x in range(1,3):
reference = 'sampledict' + str(x)
print(reference[1])
I apologize if the question is basic, as I am somewhat new to python.