标签:函数
#!/usr/bin/env python #encoding:utf-8 def sum(x,*xarg): print x sum=x print xarg for i in xarg: sum+=i return sum if __name__ == "__main__": result=sum(1,2,3,4,6,7) print result
[root@oldboy ~]# cat ts.py #!/bin/python #coding:utf-8 def add_function(a, b): c = a + b return c if __name__ == "__main__": result = add_function(10,20): return result [root@oldboy ~]#
本文出自 “砖家博客” 博客,请务必保留此出处http://wsxxsl.blog.51cto.com/9085838/1834918
标签:函数
原文地址:http://wsxxsl.blog.51cto.com/9085838/1834918