title: set a key without value for a dictionary in python
body: <p>I am trying to set a dictionary for the staff's salary in Python.  I want to create two functions, <code>getname()</code> and <code>getsalary()</code> so I tried:  </p>
  
  <pre><code>empDic={}
  
  def setname(n):
  
  empDic={'n':''}
  </code></pre>
  
  <p>And then in python interactive 2.7 I typed:</p>
  
  <pre><code>&gt;&gt;&gt;setname('marson')
  
  &gt;&gt;&gt;print empDic
  
  {}
  </code></pre>
  
  <p>The result is still an empty dictionary, How can I deal with that?</p>