2019年3月10日

python3.6 内置函数

摘要: python内置函数 归纳版:https://docs.python.org/3/library/functions.html # encoding: utf-8 # module builtins # from (built-in) # by generator 1.145 """ Built-i 阅读全文

posted @ 2019-03-10 13:22 yukun093 阅读(676) 评论(0) 推荐(0) 编辑

2019年3月8日

装饰器,文件处理(增,删,改,查)

摘要: 1.装饰器基本定义 装饰器的组成:高阶函数,函数嵌套,闭包 高阶函数有两种类型:1函数的参数是函数名 2函数返回值是函数名 装饰器不能违反的原则:1不修改被修饰函数的源代码 2不修改被修饰函数的调用方式 装饰器作用:为已经存在的对象加上额外的功能 2.装饰器基本框架 3.装饰器综合实例:判断参数+文 阅读全文

posted @ 2019-03-08 16:49 yukun093 阅读(173) 评论(0) 推荐(0) 编辑

2019年2月28日

leetcode习题练习

摘要: day001 两数之和 #!user/bin/env python # -*- coding:utf-8 -*- #方法1 def Sum(nbs,tgt): len_nums = len(nbs) for i in range(len_nums): for j in range(i+1,len_n 阅读全文

posted @ 2019-02-28 01:07 yukun093 阅读(144) 评论(0) 推荐(0) 编辑

2019年2月26日

文件处理,三元操作符,seek()函数,迭代函数和列表解析,reduce函数

摘要: 1.文件读取方类型 r,r+,w,x,a, r,读文件 w,写文件,文件内容全部删除,并将新内容从第一行开始赋值 x,写文件,只有文件不存在,可写,文件存在,报错 a,在文件莫问追加信息 r+,w+,x+,a+ 文件均为可读可写 rb,wb,xb,ab rb,b的方式不能指定编码,读出原生二进制码, 阅读全文

posted @ 2019-02-26 00:29 yukun093 阅读(486) 评论(0) 推荐(0) 编辑

2019年2月22日

zip()函数,max()和min(),built-in function,import模块,read(),readlines(),write(),writelines(),with..as..文件处理方式

摘要: zip()函数:将可迭代对象作为参数,将对象中的对应元素打包成一个个元组。 #map()普通的输出例子 print(list(zip(('a','n','c'),(1,2,3)))) print(list(zip(('a','n','c'),(1,2,3,4)))) print(list(zip(( 阅读全文

posted @ 2019-02-22 10:41 yukun093 阅读(335) 评论(0) 推荐(0) 编辑

2019年2月18日

scoping作用域,anonymous function匿名函数,内置函数

摘要: 作用域练习1 def test1(): print('in the test1') def test(): print('in the test') return test1 res = test() print(res()) #res = test1地址 函数没有return,默认返回None 作 阅读全文

posted @ 2019-02-18 20:44 yukun093 阅读(188) 评论(0) 推荐(0) 编辑

2019年2月17日

前向引用,全局变量和局部变量,递归函数

摘要: 1.全局变量与局部变量练习 1 # -*- coding: UTF-8 -*- 2 def bar(): 3 print('from bar') 4 def foo(): 5 print('from foo') 6 bar() 7 foo() 8 9 name = 'lhf' 10 def chan 阅读全文

posted @ 2019-02-17 15:57 yukun093 阅读(213) 评论(0) 推荐(0) 编辑

2019年2月14日

字符串格式化,函数,组,递归,练习

摘要: 1 # -*- coding: UTF-8 -*- 2 msg = 'i am {} my hobby is {}'.format('lhf',18) 3 print(msg) 4 5 msg1 = 'i am %s my hobby is %s' % ('lhf',[1,2]) 6 print(m 阅读全文

posted @ 2019-02-14 15:10 yukun093 阅读(252) 评论(0) 推荐(0) 编辑

2018年12月27日

linux的常用操作和基本的命令语句【完结】

摘要: Linux入门 linux简介 学习目的:linux服务器操作系统稳定长期运行,python,pycharm装于linux上 linux系统组成 应用软件:调用系统软件接口 linux操作系统分两类:1)系统调用接口(调用内部接口),系统分组概念(1组,2组,3组); 2)内核:负责管理PC所有物理 阅读全文

posted @ 2018-12-27 00:37 yukun093 阅读(4684) 评论(0) 推荐(0) 编辑

导航