I want to know if it is possible to compare if a string is equal with a variable name. For example I have the following declaration:
S=['A']
A=[['C'],['A','c','C']]
C=[['a'],['b'],['d','D']]
D=['A','e']
M=[S,A,C,D]
temp=[]
and
temp.append(S[0])
if S[0] in M :
...
Therefore I need to check if a string is equal with a variable name. Is it possible to do this? Thanks.
Mcontains a reference to the same list as whatArefers to? Python names are mere references; what if there is aBthat refers to the same list, for example?