title: I'm writing a program to pass a variable to a function that adds terms to a library and I'm getting a KeyError in python
body: <pre><code>if userChoice == 3:
      term = input("What term do you wish to add: ")
      dictionary_insert(term)
  </code></pre>
  
  <p>This is the code that calls the function into play.</p>
  
  <pre><code>def dictionary_insert(w):
      #code
      term = acronyms[w]
      if term not in acronyms:
          definition = input("\nWhat's the definition?: ")
          acronyms[term] = definition
          print("\n", term, "has been added.")
      else:
          print("\nThat term already exits!")
      return(w)
  </code></pre>
  
  <p>This is the function itself.  I don't know why i get a key error when I do this.  Did I not pass a variable correctly?</p>