title: Creating a Python Dictionary using Keys with Wildcards
body: <p>I am looking to create <strong>a Python dictionary with keys that contain wildcards</strong>. Is this possible?</p>
  
  <p>Currently, I am creating a program that finds the point values associated with a particular type of scoring. For example, what is the point value associated with a <code>'Four-of-a-Kind'</code> or a <code>'Straight'</code>. The problem is that there are several types of four of a kind (i.e. <code>'Four-of-a-Kind-(1)', 'Four-of-a-Kind-(2)',...</code>) that all have the same point values.</p>
  
  <p><strong>Here is what I have so far:</strong>   </p>
  
  <pre><code>mode_value = {'1-Spot': 100,
                '5-Spot': 500,
                'Three-of-a-Kind-(1)': 300,
                'Three-of-a-Kind-(2)': 200,
                'Three-of-a-Kind-(3)': 300,
                'Three-of-a-Kind-(4)': 400,
                'Three-of-a-Kind-(5)': 500,
                'Three-of-a-Kind-(6)': 600,
                'Four-of-a-Kind-(1)': 1000,
                'Four-of-a-Kind-(2)': 1000,
                'Four-of-a-Kind-(3)': 1000,
                'Four-of-a-Kind-(4)': 1000,
                'Four-of-a-Kind-(5)': 1000,
                'Four-of-a-Kind-(6)': 1000,
                'Five-of-a-Kind-(1)': 2000,
                'Five-of-a-Kind-(2)': 2000,
                'Five-of-a-Kind-(3)': 2000,
                'Five-of-a-Kind-(4)': 2000,
                'Five-of-a-Kind-(5)': 2000,
                'Five-of-a-Kind-(6)': 2000,
                   ...
                'Straight': 1500 }  
  </code></pre>
  
  <p>Given the dictionary has a key containing the scoring mode, it returns the value of that particular mode:</p>
  
  <pre><code>In [1]: mode_value['Four-of-a-Kind-(3)']
  Out [1]: 1000
  </code></pre>
  
  <p>This creates a large amount of repetition. For example, when I get to the <code>'Four-of-a-Kind-w/Pair-(*)'</code> which can be with any of the six types of four of a kinds with any of the six types of two of a kinds, all producing the same score.</p>
  
  <p><strong>Here is something like what I want:</strong></p>
  
  <pre><code>mode_value = {'1-Spot': 100,
                '5-Spot': 500,
                'Three-of-a-Kind-(1)': 300,
                'Three-of-a-Kind-(2)': 200,
                'Three-of-a-Kind-(3)': 300,
                'Three-of-a-Kind-(4)': 400,
                'Three-of-a-Kind-(5)': 500,
                'Three-of-a-Kind-(6)': 600,
                'Four-of-a-Kind-(*)': 1000,
                'Five-of-a-Kind-(*)': 2000,
                'Six-of-a-Kind-(*)': 3000,
                'Three-Pairs-(*)': 1500,
                'Two-Triplets-(*)': 2500,
                'Four-of-a-Kind-w/Pair-(*)': 1500,
                'Straight': 1500 } 
  </code></pre>
  
  <p><strong>What I have seen so far:</strong></p>
  
  <p>A search of the forms only pulls up questions about using a wildcard in querying a dictionary, not creating one. (i.e. <a href="https://stackoverflow.com/questions/21024822/python-accessing-dictionary-with-wildcards">Python, accessing dictionary with wildcards</a>)</p>
  
  <p>Another question used comprehension to create a similar effect (i.e. <a href="https://stackoverflow.com/questions/22413048/creating-a-python-dictionary-using-a-comprehension">Creating a Python dictionary using a comprehension</a>), but I feel like given how most things are in Python, there has to be a simpler way.</p>
  
  <p>Again, is this possible in Python? It would greatly simplify writing similar bits of this part of the code for other types of scoring.</p>