title: How do I change tuple values in a dictionary?
body: <p>I have this dictionary:</p>
  
  <pre><code>d = {'a': (1, 2, 'a'), 'b': (1, 2, 'b'), 'c': (2, 4, 'c'), 'd': (1, 3, 'd'), 'e': (0, 1, 'e'), 'f': (0, 1, 'f'), 'g': (1, 3, 'g'), 'h': (0, 1, 'h'), 'j': (1, 2, 'j'), 'i': (0, 1, 'i'), 'k': (-1, 0, 'k')}
  </code></pre>
  
  <p>How can I subtract the value by 1 for a specific key/value pair in this dictionary if the key matches the parameter?</p>
  
  <p>For example, I want to subtract the values of key <strong>a</strong> by 1, so that it now displays:</p>
  
  <pre><code>{'a': (0, 1, 'a')
  </code></pre>
  
  <p>How can I edit the values of that specific key and decrease only the integers by 1 while creating the same dictionary again?</p>
  
  <p><strong>Code so far:</strong></p>
  
  <pre><code>def matching(key_to_subtract): 
      for key, value in d.items():
          if key_to_subtract == key:
  
  
  matching("a")
  </code></pre>
  
  <p><strong>Desired Output:</strong></p>
  
  <pre><code>{'a': (0, 1, 'a'), 'b': (1, 2, 'b'), 'c': (2, 4, 'c'), 'd': (1, 3, 'd'), 'e': (0, 1, 'e'), 'f': (0, 1, 'f'), 'g': (1, 3, 'g'), 'h': (0, 1, 'h'), 'j': (1, 2, 'j'), 'i': (0, 1, 'i'), 'k': (-1, 0, 'k')}
  </code></pre>