title: Cannot use a returned value
body: <p>New to python, probably a dumb question. It's saying the &quot;addAns&quot; in the last line is undefined. How do I get it to use the value from the add function</p>
  <pre><code>def add (addL):
      c = 0
      while c &lt; 4:
          x = input(&quot;Type a number to add. &quot; )
          c += 1
          addL.append(x)
          if x == &quot;end&quot;:
              c += 5
              addL.remove(&quot;end&quot;)    
      addStep = [int(i) for i in addL]
      addAns = sum(addStep)
      return addAns
  userIn = input(&quot;What function would you like to perform? &quot;)
  if userIn == 'add':
      add(addL)
      print(addAns)
  </code></pre>