摘要: 用刚学的eval()方法对代码进行了改进,感觉发现了新大陆 阅读全文
posted @ 2018-05-10 19:32 Octopuslnlzy 阅读(193) 评论(0) 推荐(0) 编辑
摘要: #!/usr/local/bin/python3 # -*- coding:utf-8 -*- ''' #----------函数位置参数和关键字参数---------- def test(x,y): #此处的 x,y为形参 print(x) print(y) test(1,2) #位置参数调用-此处的 1,2为实参,且与形参一一对应 test(y=2,x=1) ... 阅读全文
posted @ 2018-05-10 19:30 Octopuslnlzy 阅读(1042) 评论(0) 推荐(0) 编辑
摘要: #!/usr/local/bin/python3 # -*- coding:utf-8 -*- ''' #-----------定义函数---------- def func1(): "test1" print('in the func1') return 0 #-----------定义过程---------- def func2(): "test2" ... 阅读全文
posted @ 2018-05-10 19:30 Octopuslnlzy 阅读(5072) 评论(0) 推荐(0) 编辑