摘要: 1.sep设定分割符 2.end 默认是换行可以打印到下一行 print(1,2,3,sep='|') 1|2|3 print(1,2, end=' ') print(3,4) ''' 1 2 3 4 ''' 文件写入的另一种方式 f=open('log','w',encoding='utf 8') 阅读全文
posted @ 2019-06-26 11:57 God_with_us 阅读(176) 评论(0) 推荐(0) 编辑
摘要: exal exce hash():获取一个对象(可哈希对象:int,str,Bool,tuple)的哈希值。 help()函数用于查看函数或模块用途的详细说明。 callable 函数用于检查一个对象是否是可调用的。如果返回True,object仍然可能调用失败;但如果返回False,调用对象ojb 阅读全文
posted @ 2019-06-26 11:55 God_with_us 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 两种模式: 循环模式,筛选模式 匿名函数 匿名函数:没有名字的函数 匿名函数只能构建简单的函数,一句话函数。 def func(x,y): return x+y print(func(1,2)) 匿名函数构建 func2=lamda x,y:x+y print(func2(1,2)) 匿名函数最常用 阅读全文
posted @ 2019-06-26 11:53 God_with_us 阅读(105) 评论(0) 推荐(0) 编辑