title: Try and Except exceptions with a dictionary (Python)
body: <p>Let's say I asked the user for a word, if the word is not a key in the dictionary, then I want to print "That word is not a key in the dictionary, try again". How would I do this using try and except? This is what I have so far.</p>
  
  <pre><code>dict = {"These": 1, "are": 2, "words": 3}
  while True:
      try:
          w = input("Enter a word: ")
      except: 
          print("That word is not a key in the dictionary, try again")
      else:
          print("That word is a key in the dictionary")
  </code></pre>