title: Python Dictionary Fuzzy Match on keys
body: <p>I have the following dictionary:</p>
  
  <pre><code>classes = {'MATH6371': 'Statistics 1', 'COMP7330': 'Database Management', 
  'MATH6471': 'Statistics 2','COMP7340': 'Creative Computation' }
  </code></pre>
  
  <p>And I am trying make a raw_input fuzzy match on the dictionary keys. For example, if I type in 'math', the output would be Statistics 1 and Statistics 2. </p>
  
  <p>I have the following code, but it only matches keys exactly:</p>
  
  <pre><code>def print_courses (raw_input):
      search = raw_input("Type a course ID here:")
      if search in classes:
         print classes.get(search)
      else: 
         print "Sorry, that course doesn't exist, try again"
  
  print_courses(raw_input) 
  </code></pre>
  
  <p>Thanks</p>