You can use the varname
library (its not part of the standard python library, so you have to install it). Sample code:
from varname import nameof
some_var1 = "somevar1"
some_var2 = "somevar2"
lst = [somevar1, somevar2]
print(nameof(lst[0]), nameof(lst[1]))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…