python语法重点参考
一个学习各种脚本语言的网站(IT加油站),方便referencehttp://www.fzs8.net/python/Python 在函数中接收元组和列表当要使函数接收元组或字典形式的参数的时候,有一种特殊的方法,它分别使用和**前缀。这种方法在函数需要获取可变数量的参数的时候特别有用。>>> def powersum(power, args):… ‘’’Return the sum of each argument raised to specified power.’’’… total = 0… for i in args:… total += pow(i, power)… return total
...