How to write a function to return the variable name in Python
<p>I want a function that can return the variable/object name as str like this :</p>

<pre><code>def get_variable_name (input_variable):
    ## some codes

&gt;&gt;get_variable_name(a)
'a'

&gt;&gt;get_variable_name(mylist)
'mylist'
</code></pre>

<p>it looks like silly but i need the function to construct expression regarding to the variable for later on 'exec()'. Can someone help on how to write the 'get_variable_name' ?</p>
