01 2017 档案
摘要:func=lambda a: a+1 ret=func(99) print(ret)
阅读全文
摘要:def show(arg): print(arg) n=[11,22,33] show(n) def show(*arg): print(arg,type(arg)) show(1,11,22,33) (1,11,22,33) tuple def show(**arg): print(arg,typ
阅读全文
摘要:#无参数 #show() 》show() #一个参数 def show(arg): print(arg) show('kkk') #两个参数 def show(arg,xx): print(arg,xx) show('kkk','77') #默认参数,必须放在最后 def show(a1,a2=99
阅读全文
摘要:def mail(): n=123 n+=1 print(n) return 1 mail() 执行 # import smtplib from email.mime.text import MIMEText from emial.utils import formataddr def mail(u
阅读全文
摘要:collection 类 dic=collections.OrderedDict()//有序字典 //dic=dict() dic['k1']='v1' dic['k2']='v2' dic['k3']='v3' print(dic) dic.move_to_end('k1')//把第一个移到最后
阅读全文