首先:
def f(): print('first')def g(): f()g()def f(): print('second')g()
结果:
>>> firstsecond
又来:
def g(): f()g()def f(): print('second')g()
结果:
NameError: global name 'f' is not defined
再来:
def g(): f()def f(): print('second')g()
结果:
>>> second