 <p>You can use the dictionary returned by a call to <code>globals()</code>:</p> <pre><code>input_name = raw_input("Enter variable name:") # User enters "orange" globals()[input_name] = 4 print(orange) </code></pre> <p>If you don't want it defined as a global variable, you can use <code>locals()</code>:</p> <pre><code>input_name = raw_input("Enter variable name:") # User enters "orange" locals()[input_name] = 4 print(orange) </code></pre>