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)
View Code

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

posted on 2017-01-01 18:17  忍冬的你  阅读(191)  评论(0编辑  收藏  举报