mf

Understanding Args and Kwargs in Python

In this tutorial, I will be focusing on arguments (*args) and keyword arguments (*kwargs) in Python. I will teach you what args and kwargs are and, most importantly, how to use them—that is how to take in an unlimited number of arguments and keyword arguments in functions. What Are Args?*args are used to pass non-keyword arguments. Examples of non-keyword arguments are fun(3,4), fun("foo","bar"). *args are usually used as a measure to prevent the program from crashing if we don’t know h

Already have an account? Log in here

This article is FREE for you...

Create a free account to access all articles and get more of the technical news sent to you by newsletter.

By submitting your email address you agree for Medianic to send you communication by email

Leave a Comment

Scroll to Top