![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
我只是个小白白
这个作者很懒,什么都没留下…
展开
-
Python3.6新的字符串格式化语法
个人理解字符串格式化 可以在" " 或者 ’ ’ 内直接使用变量带来的值 f-Strings python 最新的字符串格式化语法 name = 'lucy' age = 14 info = f'Her name is {name}, her age is {age}.' print(info) => Her name is lucy, her age is 14. 前几代版本 %...原创 2019-06-11 22:15:19 · 518 阅读 · 0 评论 -
python的浅拷贝与深拷贝
浅拷贝 上代码!!! array = [1,2] other_array = array array.append(3) array [1,2,3] other_array [1,2,3] python为了节省内存以及加快运行速度,使用了浅拷贝——将所拷贝变量的指针指向相同的地址,这样,我们对array处理实际上就是对array指向的地址进行处理,other_array的值也因此改变 深拷...原创 2019-06-17 21:34:37 · 147 阅读 · 0 评论