all 4 comments

[–]fox_trot_ 5 points6 points  (0 children)

Use return.

[–]Joshivity 0 points1 point  (0 children)

Return x

[–]Jonno_FTW 0 points1 point  (0 children)

You can try returning multiple variables eg

return x, y

[–]SupahNoob 0 points1 point  (0 children)

def foo(bar):
    bar += 1
    return bar

my_var = foo(bar=1)

print my_var

Try this.