title: Passing Key:Value Pairs to Function
body: <p>I would like to iterate through the key:value pairs in a dictionary and pass them as arguments in a function. In the function I am trying to return the value I am getting from an API call. My ultimate goal is to set the keys equal to the value I am getting from the API call.</p>
  
  <pre><code>def SomeFunction(key,val):
      return APICall(val)
  
  
  myDict = {'a' : 'A',
            'b' : 'B',
            'c' : 'C'
           }
  for key,val in myDict.items():
      key = SomeFunction(key,val)
  
  print a
  #&gt;&gt;&gt;'return value from API'
  </code></pre>
  
  <p>When I run this I get an error saying 'a' is not defined. I am struggling to understand why </p>
  
  <pre><code>key = SomeFunction(key,val)
  </code></pre>
  
  <p>does not instantiate the given key with the assignment of the return value from the API call.</p>
  
  <p>Any help would be great.</p>