
上QQ阅读APP看书,第一时间看更新
Positional arguments
Positional arguments are read from left to right and they are the most common type of arguments:
# arguments.positional.py
def func(a, b, c):
print(a, b, c)
func(1, 2, 3) # prints: 1 2 3
There is not much else to say. They can be as numerous as you want and they are assigned by position. In the function call, 1 comes first, 2 comes second, and 3 comes third, therefore they are assigned to a, b, and c, respectively.