摘要: # info=['egon','male',18,180,75]### info_dic={'name':'egon','age':18,'sex':'male'} # 有对应关系# 常用操作:优先掌握## 存/取info_dic={'name':'egon','age':18,'sex':'mal 阅读全文
posted @ 2017-07-20 19:37 Cool· 阅读(182) 评论(0) 推荐(0) 编辑
摘要: # x=10#链式赋值# a=b=c=d=e=f=10# print(a,b,c,d,e,f)#增量赋值# x=10# y='a'# temp=x# x=y# y=temp# print(x,y)# x,y=y,x# print(x,y)#值的解压# msg='hello'# l=[1,2,3]# 阅读全文
posted @ 2017-07-20 18:58 Cool· 阅读(171) 评论(0) 推荐(0) 编辑
摘要: # msg='hello'# msg=[1,2,3,4,5,6]# msg=(1,2,3,4,5,6)# index=0# while index < len(msg):# print(msg[index])# index+=1# msg_dic={# 'apple':10,# 'tesla':10 阅读全文
posted @ 2017-07-20 16:21 Cool· 阅读(163) 评论(0) 推荐(0) 编辑
摘要: #为何要有元组,存放多个值,元组不可变,更多的是用来做查询# t=(1,[1,3],'sss',(1,2)) #t=tuple((1,[1,3],'sss',(1,2)))# print(type(t))# #元组可以作为字典的key# d={(1,2,3):'egon'}# print(d,typ 阅读全文
posted @ 2017-07-20 15:59 Cool· 阅读(176) 评论(0) 推荐(0) 编辑
摘要: # l=[1,2,3] #l=list([1,2,3])# print(type(l))#pat1 》优先掌握部分# 索引## 切片l=['a','b','c','d','e','f']# print(l[1:5])# print(l[1:5:2])# print(l[2:5])# print(l[ 阅读全文
posted @ 2017-07-20 15:44 Cool· 阅读(168) 评论(0) 推荐(0) 编辑