1、(已解决)
test = [1, 2, 3, 4] print("1", id(test)) def func(a): print("2", id(a)) a = a.remove(1) print("3", id(a)) return a c = func(test) print("4", id(c)) print(c) print(test)
输出结果:
为什么会输出None???
原因:a.remove(1) 本身就返回None。。。好菜呀??
原文:https://www.cnblogs.com/fuqia/p/9074809.html