In python functions aren't accessible magically from everywhere (like they are in say, php). They have to be declared first. So this will work:
def pyth_test (x1, x2):
print x1 + x2
pyth_test(1, 2)
But this won't:
pyth_test(1, 2)
def pyth_test (x1, x2):
print x1 + x2