2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Enders_Game
0

one way is to return it

e.g.

def func():
   variable = 3
   return variable

x = func()
print(x)

In this example, you call the function func() it does stuff and returns variable.
variable is assigned to x.

Edited by Enders_Game: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.