title: Modify all values in a dictionary
body: <p>Code goes below:</p>
  
  <pre><code>d = {'a':0, 'b':0, 'c':0, 'd':0}  #at the beginning, all the values are 0.
  s = 'cbad'  #a string
  indices = map(s.index, d.keys())  #get every key's index in s, i.e., a-2, b-1, c-0, d-3
  #then set the values to keys' index
  d = dict(zip(d.keys(), indices))  #this is how I do it, any better way?
  print d  #{'a':2, 'c':0, 'b':1, 'd':3}
  </code></pre>
  
  <p>Any other way to do that?</p>
  
  <p>PS. the code above is just a simple one to demonstrate my question.</p>