![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
python基础原理
开始King
这个作者很懒,什么都没留下…
展开
-
python赋值浅拷贝深拷贝的不同
python赋值,浅拷贝,深拷贝的区别原创 2022-05-14 17:38:00 · 373 阅读 · 0 评论 -
python中datetime和time中的时间格式的转换
time.mktime()将人类易读的时间格式转化成时间戳time.strftime()把time.struct_time转换成string原创 2021-10-28 17:42:08 · 2069 阅读 · 0 评论 -
pycharm不能使用已经安装的第三方库
电脑已经通过pip或离线等方式安装了第三方库,但是pycharm中其实我们在创建项目的时候可以点上这样就行了原创 2021-08-24 12:16:23 · 3563 阅读 · 0 评论 -
python append()与extend()函数的区别
append函数是在列表尾部添加元素extend函数是把新列表的所有元素添加到原列表末尾例如:使用append时a=[1,2,3];b=[4,5,6]a.append(b)print(a)输出结果:D:\python\python.exe "D:/应用/PyCharm Community Edition 2020.3.4/pythonProject3/second.py"[1, 2, 3, [4, 5, 6]]Process finished with exit code 0使用原创 2021-03-30 20:30:34 · 234 阅读 · 1 评论 -
python list tuple下表访问
d_3=((1,2),(3,4),(5,6))print(d_3[1][1],end=' ')print(d_3[0][0])d_2=[(1,2),(3,4),(5,6)]print(d_2[1][1],end=' ')print(d_2[0][0])输出结果:D:\python\python.exe "D:/应用/PyCharm Community Edition 2020.3.4/pythonProject3/second.py"4 14 1Process finished wi原创 2021-03-30 20:14:45 · 146 阅读 · 0 评论 -
Python 运算符重载中__add__(self,other)
python中的def add(self, other):就是对加法(+)重载,如下代码 def __add__(self, other): #重载+号 r=Vecter() r.x=self.x+other.x r.y=self.y+other.y r.z=self.z+other.z return rself.x指的是实例对象t1的属性值other.x指的是实例对象t2的属性值例如创建一个三维向量类,实现向原创 2021-04-11 19:45:18 · 5046 阅读 · 3 评论