会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
所有的程序员都是编剧,所有的计算机都是烂演员。   
返回顶部
steven丶syw
Quiet as the sky, soaring like an eagle. 长春工业大学在校大三学生.
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
下一页
2018年5月18日
python——基本数据类型一、运算符(赋值运算符)
摘要:
阅读全文
posted @ 2018-05-18 14:04 steven丶syw
阅读(140)
评论(0)
推荐(0)
编辑
python——基本数据类型 一、运算符(算数运算符)
摘要:
阅读全文
posted @ 2018-05-18 14:02 steven丶syw
阅读(193)
评论(0)
推荐(0)
编辑
2018年5月13日
python——函数 15、闭包函数
摘要: a=1 def foo(): a=2 def foo2(): print(a) return foo2 y=foo() y() 包三层 def egon_name(): name='Steven' def monthly_pay(): money = 100000 def hehe(): print
阅读全文
posted @ 2018-05-13 12:16 steven丶syw
阅读(118)
评论(0)
推荐(0)
编辑
2018年4月26日
python——函数 14、global与nonlocal
摘要: 1、global:在局部修改全局变量 x=100 def foo(): global x x=200 foo() print(x) #todo 如果不写global,则打印为100 2、nonlocal:只在函数内部找变量,如果没有则报错 x=100 def a(): x=200 def b():
阅读全文
posted @ 2018-04-26 18:22 steven丶syw
阅读(118)
评论(0)
推荐(0)
编辑
2018年4月25日
python——函数 13、面向对象
摘要: 1、可引用 def foo(): return ('hello world!') a=foo print(a()) 2、可当返回值 def outer(): def inner(): print(111) return inner y=outer() y() #todo 如果将111改为inner
阅读全文
posted @ 2018-04-25 23:40 steven丶syw
阅读(180)
评论(0)
推荐(0)
编辑
2018年4月23日
python——函数 12、作用域
摘要: a=1 def foo(): print(a) def foo2(): print(a) foo2() def foo3(): print(a) foo() foo3() def x1(): #todo 从内往外看 a=10 def x2(): a=20 def x3(): a=30 print(a
阅读全文
posted @ 2018-04-23 19:27 steven丶syw
阅读(174)
评论(0)
推荐(0)
编辑
2018年4月22日
python——函数 11、命名空间
摘要: a=10 def foo(): print(a) foo() # def foo2(a,b): # c=1 # print(a,b,c) # foo2(10,9) a=10 def foo1(): a=20 print(a) foo1() # 因为局部有一个值 所以打印为20 b=10 def fo
阅读全文
posted @ 2018-04-22 19:57 steven丶syw
阅读(169)
评论(0)
推荐(0)
编辑
python——函数 10、函数的嵌套
摘要: 在一个函数里再加一层或多层函数 def f1(): #todo 注意代码的缩进 def f2(): def f3(): print('c') f3() print('b') f2() print('a') f1()
阅读全文
posted @ 2018-04-22 19:15 steven丶syw
阅读(168)
评论(0)
推荐(0)
编辑
python——函数 9、可变长参数用处
摘要: def foo(*args,**kwargs): print(args) print(kwargs) foo(1,21,111,22,11,x=1,y=2,z=3) # todo 可以接收任意形式,任意长度的参数 # todo 一定是**在后面 因为关键字必须在后
阅读全文
posted @ 2018-04-22 19:12 steven丶syw
阅读(167)
评论(0)
推荐(0)
编辑
Python——函数 8、可变长参数
摘要: def func(x,y,*args): print(x,y) print(args) func(1,2,3,4,5) # *处理按位置定义的多出的实参 # 然后赋值给*后的变量来保存成一个元组的形式 # args=(3,4,5) 1、等效 def func(x,y,*args): print(x,
阅读全文
posted @ 2018-04-22 19:07 steven丶syw
阅读(225)
评论(0)
推荐(0)
编辑
上一页
1
2
3
4
5
6
下一页
公告