title: Is it possible to assign the same value to multiple keys in a dict object at once?
body: <p>In Python, I need a dictionary object which looks like:</p>
  <pre><code>{'a': 10, 'b': 20, 'c': 10, 'd': 10, 'e': 20}
  </code></pre>
  <p>I've been able to get this successfully by combining the <code>dict.update()</code> and <code>dict.fromkeys()</code> functions like so:</p>
  <pre><code>myDict = {}
  myDict.update(dict.fromkeys(['a', 'c', 'd'], 10))
  myDict.update(dict.fromkeys(['b', 'e'], 20))
  </code></pre>
  <p>However, because the code is being written for novice users who may need to make add keys/values on occasion, I'd prefer a simple bare-bones (Perl-like) syntax such as:</p>
  <pre><code>myDict = {}
  myDict['a', 'c', 'd'] = 10
  myDict['b', 'e'] = 20
  </code></pre>
  <p>This, however, gives me:</p>
  <pre><code>myDict = {('a', 'c', 'd'): 10, ('b', 'e'): 20}
  </code></pre>
  <p>Is there a way I can simplify my first example (using <code>dict.update()</code> and <code>dict.fromkeys()</code>) further, and get the dict object I'm looking for?</p>
  <p>Or, alternatively, if I have a dict with tuples as in my second example, is there an easy way for me to do a lookup such as <code>myDict['c']</code> or <code>myDict.get('c')</code> and get the value 10?</p>