def printme(x):
    keys_list = [key for key, value in globals().items() if value == x]
print(keys_list)
for key in keys_list:
    if id(globals()[key]) == id(x):
        result = '%s = %s' % (key, x)
print(result)
break
return result
Python 2.7 using the input to a function as a string and variable