天天看点

dasda(大s打陈建州)

什么事Sysdasda
梦游就梦游,你自己又醒不过来,如果白天睡觉你梦游的话,提前告诉你爸妈,说我如果梦游就叫醒我,这样可以安全
python函数中def func(*args)这里*的作用是什么?
def fun_var_args(farg, *args):  
print "arg:", farg  
for value in args:  
print "another arg:", value  
fun_var_args(1, "two", 3) # *args可以当作可容纳多个变量组成的listapply(function, args[, keywords])
the function argument must be a callable object (a user-defined or built-in function or method, or a class object) and the argsargument must be a sequence. the function is called with args as the argument list; the number of arguments is the length of the tuple. if the optional keywords argument is present, it must be a dictionary whose keys are strings. it specifies keyword arguments to be added to the end of the argument list. calling apply() is different from just calling function(args), since in that case there is always exactly one argument. the use of apply() is equivalent to function(*args, **keywords).
deprecated since version 2.3: use function(*args, **keywords) instead of apply(function, args, keywords) (see unpacking argument lists).
你看看文档嘛。。。。就是当call这个object时调用self.func并且使用self.args给的参数。。*args是多个变量组成的元组(tuples)
附上代码:
def count_number(*args):
print(args)
print(type(args))
count_number('hgfh','dasda')