![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 61
我要读博士
我的考博之路。
展开
-
元组
元组中的元素是不可以改变和删除的。temp = (1)temp 并不是一个元组, type(temp) 为inttemp2 = 2,3,41,1 temp2为元组tuple1 = ( ) 为一个空元组 tuple1 = 1, 或 tuple1 = [1,]都是创建一个元组8 * (8) 得到64 8 * (8,) 得到一个元组改变元组用切片的方法: temp = ('小...原创 2018-05-08 20:40:43 · 165 阅读 · 0 评论 -
列表
list1 = [12,3,41,1]1 in list1 list1 *= 3list3.index(123,3,7) list3.index(value ,start,end) list3.reverse( ) 反转list.sort( )list1 = [1,3,41,41,1]list2 = list1 list1.sort( )list2 也同时改变了list1 和 list2 是两...原创 2018-05-07 20:05:16 · 194 阅读 · 0 评论