摘要: # 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) 编辑
摘要: # name='egon' #name=str('egon')# print(type(name))#优先掌握# 移除空白strip# msg=' hello '# print(msg)# print(msg.strip())# msg='***hello*********'# msg=msg.st 阅读全文
posted @ 2017-07-19 17:31 Cool· 阅读(167) 评论(0) 推荐(0) 编辑
摘要: # >part1:数字类型#掌握:int,float#了解:Long(在python2中才有),complex# num=10# num=int(10)# print(type(num),num)# salary=12.5# salary=float(12.5)# print(type(salary 阅读全文
posted @ 2017-07-19 16:37 Cool· 阅读(221) 评论(0) 推荐(0) 编辑
摘要: #coding:utf-8 #utf-8格式打开#%s %d# name='egon'# age=18# print('my name is',name)# print('my name is my age is',name,age)#%s既能接收字符串,也能接收数字# print('my name 阅读全文
posted @ 2017-07-19 16:07 Cool· 阅读(529) 评论(0) 推荐(0) 编辑
摘要: # if 条件:# 子代码1# 子代码2# 子代码3# if True:# print('ok')# print(' ?>')# print(' ?>')# print(' ?>')# print(' ?>')# print(' ?>')# age=int(input('您芳龄几何>>: '))# 阅读全文
posted @ 2017-07-18 15:28 Cool· 阅读(134) 评论(0) 推荐(0) 编辑
摘要: # while 条件:# 循环体的代码1# 循环体的代码2# 循环体的代码3# count=0# while count < 10:# print(count)# count+=1# while True: #死循环# print('ok')# while 1: #死循环# print('ok')# 阅读全文
posted @ 2017-07-18 15:28 Cool· 阅读(159) 评论(0) 推荐(0) 编辑
摘要: #了解部分#字符串+,*#列表:+,*# l1=[1,2,3]# l2=[4,5]## print(l1+l2)# print(l1*3)#比较运算符# num1=3# num2=1# print(num1 > num2)# print(num1 = num2)# print(num1 >> num1=1234567890123456789>>> num2=1234567890123456789>... 阅读全文
posted @ 2017-07-18 15:27 Cool· 阅读(184) 评论(0) 推荐(0) 编辑