Suppose there is this program
def function():
print(variable)
def main():
variable = "Hello"
function()
def main_2():
variable="Bye"
function()
main()
main_2()
there's an error that variable is not defined
I am going to use the function function() a lot, and I want it to use the variable defined in the function main() for only main() and the variable defined in main_2() in only main_2(). How can I do that