Variable-length Arguments: *args and **kwargs in Python


Accept an arbitrary number of arguments in functions.

Source Code

def make_pizza(*toppings):
    print(toppings)
make_pizza('pepperoni', 'mushrooms', 'green peppers')
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments