saying = 1
hello = lambda value: exec("global saying; saying += 1;print(value + saying)")
hello(1)
hello(1)
hello(1)
hello(1)
hello(1)
運行結果
Connected to pydev debugger (build 191.6605.12)
3
4
5
6
7
saying = 1
hello = lambda value: exec("global saying; saying += 1;print(value + saying)")
hello(1)
hello(1)
hello(1)
hello(1)
hello(1)
運行結果
Connected to pydev debugger (build 191.6605.12)
3
4
5
6
7