title: Local variable 'x' referenced before assignment
body: <pre><code>def main():
          tests = get_initial_input(tests)
          assignments = get_initial_input(assignments)
          exercises = get_initial_input(exercises)
          labs = get_initial_input(labs)
          finals = get_initial_input(finals)
          print(tests, assignments, labs)
  
  
  def get_initial_input(x):
          val = int(input("How many", x , "were there?    "))
          return val
  
  main()
  </code></pre>
  
  <p>I keep getting an error:</p>
  
  <pre><code>UnboundLocalError: local variable 'tests' referenced before assignment
  </code></pre>
  
  <p>I've tried many different things to try to get tests to go to <code>get_initial_input()</code> but it says that it is referenced before assignment.</p>
  
  <p>How is that possible when the first line of code I'm trying to define it?</p>