摘要: 学习来源:http://www.cnblogs.com/alex3714/articles/5885096.html'''school ="old boy"def change(name): global school #函数内修改全局变量 school = "wo de " #name = 'li 阅读全文
posted @ 2017-12-22 11:56 三水淼 阅读(163) 评论(0) 推荐(0) 编辑
摘要: '''def test(x,y): print(x) print(y)test(2,y=3)def test(*args):#参数可以是不确定的多个数,接受N个位置参数,转换成元组形式 print(args)test(1,2,2,3,3,4)def test(x,*args):#参数可以是不确定的多 阅读全文
posted @ 2017-12-22 11:54 三水淼 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 打开文件的模式有: r,只读模式(默认)。 w,只写模式。【不可读;不存在则创建;存在则删除内容;】 a,追加模式。【可读; 不存在则创建;存在则只追加内容;】 "+" 表示可以同时读写某个文件 r+,可读写文件。【可读;可写;可追加】 w+,写读 a+,同a "U"表示在读取时,可以将 \r \n 阅读全文
posted @ 2017-12-22 11:51 三水淼 阅读(249) 评论(0) 推荐(0) 编辑