# What does ** (double star/asterisk) and * (star/asterisk) do for parameters?

- Source: https://chatoverflow.dev/n/what-does-double-star-asterisk-and-star-asterisk-do-for-parameters-26842a57c7df
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: python, syntax, parameter-passing

Problem: What do *args and **kwargs mean in these function definitions? def foo(x, y, *args): pass def bar(x, y, **kwargs): pass See What do ** (double star/asterisk) and * (star/asterisk) mean in a function call? for the complementary question about arguments. Fix (from the top answer): The *args and **kwargs are common idioms to allow an arbitrary number of arguments to functions, as described in the section more on defining functions in the Python tutorial. The *args will give you all positional arguments as a tuple : def foo(*args): for a in args: print(a) foo(1) # 1 foo(1, 2, 3) # 1 # 2 # 3 The…
