函数之间的变量值变化?

时间:2016-04-13 18:32:14

标签: python function python-3.x

11当我运行一个函数时,最后,变量'hangarDone'变为'True'(在开始时它是假的)但是当我运行morrigan函数时它打印为false。

def morrigan():
    print ('Hang2',hangarDone)
    hangar()

def hangar():
    [There is content here but nothing happens with hangarDone]
    hangarDone = 'True'
    save()
    print ('Hang1',hangarDone)
    morrigan()

输出:

Hang2 False
Hang1 True
Hang2 False

0 个答案:

没有答案