title: local variable use in a nested function in Python
body: <p>Could you advise which mistake that I made in the following code?</p>
  
  <pre><code>def sumOfLeftLeaves(num):
  
      mytotal = 0
  
      def helper():
          mytotal = mytotal + num
  
      helper()
      return mytotal
  
  inum = 100
  print(sumOfLeftLeaves(inum))
  </code></pre>