Computer Science, asked by jacobjacob6759, 9 months ago

What is the **args?​

Answers

Answered by mk4971957
1

Answer:

The special syntax *args in function definitions in python is used to pass a variable number of arguments to a function. It is used to pass a non-keyworded, variable-length argument list.

The syntax is to use the symbol * to take in a variable number of arguments; by convention, it is often used with the word args.

What *args allows you to do is take in more arguments than the number of formal arguments that you previously defined. With *args, any number of extra arguments can be tacked on to your current formal parameters (including zero extra arguments).

For example : we want to make a multiply function that takes any number of arguments and able to multiply them all together. It can be done using *args.

Using the *, the variable that we associate with the * becomes an iterable meaning you can do things like iterate over it, run some higher order functions such as map and filter, etc.

Explanation:

plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz mark me as brainlist

Answered by aishanisantra
0

Answer:

Args is a shortened from of the world argument.

Similar questions