Geek Culture
Published in

Geek Culture

[2022] How to use variable length arguments (*args, **kwargs) in Python

Any number of arguments (variable-length arguments) can be specified by appending * and ** (one or two asterisks) to the arguments in the function definition.

By convention, the names *args, **kwargs are often used, but other names are acceptable as long as * and ** are at the beginning.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
KASATA

KASATA

Master of Applied Physics/Programmer/Optics/Condensed Matter Physics/Quantum Mechanics/AI/IoT/Python/C,C++/Swift/WEB/Cloud/VBA