Python function definition global parameter
<p>Can someone explain why the gloabl variable x &amp; y are not recognized in printfunc,</p>

<p>code.py</p>

<pre><code>global x
global y

def test(val_x=None,val_y=None)
    x = val_x
    y = val_y
    printfunc()

def printfunc():
   print('x',x)
   print('y',y)

if __name__ = '__main__':
   test(val_x=1,val_y=2)
</code></pre>
