>>> 10-a Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'a' is not defined
>>> def fun_a(a): ... a = a+4 ... >>> g = 0 >>> fun_a(g) >>> g 0
>>> def fun_b(names): ... names[0] = ['x', 'y'] ... >>> n_list = ['a','b','c'] >>> fun_b(n_list) >>> >>> n_list [['x','y'], 'b', 'c']
以上就是图解Python变量与赋值的详细内容,更多请关注Gxl网其它相关文章!
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did81497