2018年7月3日

函数详解

摘要: def test(*args): print(args) test(1,2,3,4,5,5) test(*[1,2,4,5,5]) #传进的有参数都会被args变量收集,根据传进参数的位置合并为一个元组(tuple),args是元组类型,以元组的形式输出结果 def test2(**kwargs): 阅读全文

posted @ 2018-07-03 20:34 凛冬08 阅读(116) 评论(0) 推荐(0) 编辑

定义函数和过程

摘要: #!\usr\bin\env\python #-*- coding:utf -8 -*9 #定义函数 def func1(): "书写函数声明" print('in the func1') return 0 #定义过程 def func2(): print('in the func2') #调用函数 阅读全文

posted @ 2018-07-03 19:55 凛冬08 阅读(144) 评论(0) 推荐(0) 编辑

导航