updating an input dictionary in python
<p>I am defining a function</p>

<pre><code>def update(dictionary,key,value):
    dictionary[key] = value
   #  if i do print dictionary... it still shows the original value?
</code></pre>

<p>I want to update the input dictionary in the main call </p>

<p>So this is the main function i wrote:</p>

<pre><code>def update_mapping(mapping_dict,check_word,solution_word):
    #print "here "
    #new_mapping_dict = {}
    for i,ele in enumerate(check_word):
        if mapping_dict.has_key(ele):
            if mapping_dict[ele] == "*":
                mapping_dict[ele] = solution_word[i]

                print ele, solution_word
    print mapping_dict,check_word,solution_word
</code></pre>

<p>Basically I am inputting a misspelled word and then misspelled word has some mapping.. 
I do that mapping in the dictionary.. 
Like </p>

<pre><code> mapping_dict ={"a":"x"...."s":"*"...}
</code></pre>

<p>So all the known alphabets whose mapping have been found have a legit key value alphabet pairs..
for the alphabets for which I havent found the right mapping, I am replacing them with "*"
and I am finding them with some algorithm (inverted index)</p>

<p>And as i found those, I want to update my dictionary?</p>
