Invalid line below:
global episode = "Episode404"
But you also do not understand the concept of a global team. You must use it to change the value of a variable defined outside the scope of the current work.
That Andy answered the works, but this is not necessary, since you can do it with the same result:
episode = "Episode404"
def doIt():
print(episode)
doIt()
global , doIt(), doIt() :
episode = "Episode404"
def doIt():
global episode
print(episode)
episode = "New Episode"
doIt()
print(episode)
:
"Episode404"
"New Episode"
, doIt()?
test.py
def doIt(episode):
print(episode)
:
from testing import doIt
episode = "Episode404"
doIt(episode)
, , . , , , , .