摘要: #打开文件 # f=open('test',encoding='utf-8')#句柄,调用操作系统 # data=f.read() # print(data) # f.close() #r只读,w只写,a只追加 #f=open('test',encoding='utf-8')#默认打开只读模式 # f=open('test','r',encoding='utf-8') # # print(f.... 阅读全文
posted @ 2018-07-12 10:26 Lzxanthony 阅读(151) 评论(1) 推荐(0) 编辑
摘要: #作用域 def test1(): print(2) def test(): print(1) return test1 res=test()#运行test,返回结果赋值给res print(res())#相当于运行test1 name='lzx' def foo(): name='lcf' def bar(): print(name) ... 阅读全文
posted @ 2018-07-09 14:55 Lzxanthony 阅读(137) 评论(8) 推荐(0) 编辑
摘要: 集合 1.不同元素组成 2.无序 3.集合中元素必须是不可变类型 阅读全文
posted @ 2018-07-08 12:19 Lzxanthony 阅读(187) 评论(6) 推荐(0) 编辑
摘要: 继续学习字符串的命令 阅读全文
posted @ 2018-07-06 11:02 Lzxanthony 阅读(246) 评论(8) 推荐(0) 编辑
摘要: 学习 条件语句和循环语句 智商检测 基础版 哈哈 阅读全文
posted @ 2018-07-04 13:55 Lzxanthony 阅读(140) 评论(8) 推荐(1) 编辑