title: get and set value in python
body: <p>I want to have few global variables in my python code.
  Then set their values with set function and want to get their values through get function.</p>
  
  <p>For example:</p>
  
  <pre><code>a = None #global variable1
  
  b= None #global variable2
  
  def set(var, value):
    var = value
  
  def get(var):
    return var
  
  set(a, '1')
  get(b, '2')
  </code></pre>
  
  <p>I want to have a generic get and set function which will do this for any global variable. How can I do this in python ? The code written here gives error.</p>