Functions with Optional Arguments

Positional and keyword arguments of a function.

We'll cover the following

This section brings detailed information about an eminently used feature in Python programming. Getting a firm hold on this concept will make you a competent developer, as it brings wonders.

The *args and **kwargs parameters

The args and kwargs parameters allow a function to accept optional arguments.

  • The keyword args means positional arguments.
  • The keyword kwargs means keyword arguments.

Let’s see a simple example to get a basic understanding of these parameters.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy