我想了解print(*args)
和print(args)
之间的区别
我有两个非常简单的函数:
def print_args(*args):
print(args)
def print_xargs(*args):
print(*args)
print_args(1, 2, 3)
print_xargs(1, 2, 3)
输出:
1, 2, 3 (looks like an exact dublicate of the function input)
(1, 2, 3)
args(without asterisk) in function is just a tuple, but what is *args, does it have any type?
目前没有回答
相关问题 更多 >
编程相关推荐