A few very simple statements but why it yields UnboundLocalError
<p>I really cannot see what is wrong with these statements. I checked they are many same error posts here but I cannot find a clear answer. Can anyone explain a bit on this issue? Thanks.</p>

<pre><code>myVariable = 10

def printV():
    myVariable = myVariable + 10
    print("inside", myVariable)

printV()

print("outside", myVariable)
</code></pre>
