title: python function that contains a dict, takes a key and returns a value from that dict
body: <p>I'm trying to write a function that accepts a particular dictionary key and returns that dict value as a string. Below I'm trying to pass in a key that can be 1-4 and have it return the associated value. How do I properly do this? Here's my best guess, which just returns all the chapters, which isn't what I want.</p>
  
  <pre><code>def function(chapter_key):
      chapters = {
          1: '["chapter_1"]',
          2: '["chapter_2"]',
          3: '["chapter_3"]',
          4: '["chapter_4"]'
      }
      return chapters
  </code></pre>
  
  <p>so calling function(1) would return "chapter_1"</p>
  
  <p>edited a bit after some comments.</p>