
1 def test(a): 2 # a+=a 3 # a+=a是在原数据上的修改,而a=a+ashi先定义一个变量然后修改 4 a=a+a 5 6 print(a) 7 num=[11,22,33,44] 8 test(num) 9 print(num)
yunxingyunyunxingjieguo :
E:\Python35\python.exe F:/Exercise/Python/test0731/登陆.py
[11, 22, 33, 44, 11, 22, 33, 44]
[11, 22, 33, 44]
Process finished with exit code 0