Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Positional Arguments | Positional and Optional Arguments
course content

Зміст курсу

Python Functions Tutorial

Positional ArgumentsPositional Arguments

In Python, positional arguments are function arguments passed to a function based on their position or order. When defining a function, you can specify the parameters it expects. When calling the function, you provide the corresponding arguments in the same order as the parameters.

In all the functions of the previous chapters, we used exactly positional arguments - we explicitly indicated the arguments in the () parentheses, after which we called the function, specifying the arguments in the appropriate order.

We can also specify positional arguments when calling the function using a dictionary using argument name as a keyword and argument value as a value:

If we use this type of specification, we can specify arguments in any order:

This way of setting arguments is preferable, as it increases the readability and interpretability of the code.

question-icon

Which statements are true about the function calls?

Виберіть кілька правильних відповідей

Все було зрозуміло?

Секція 2. Розділ 1
course content

Зміст курсу

Python Functions Tutorial

Positional ArgumentsPositional Arguments

In Python, positional arguments are function arguments passed to a function based on their position or order. When defining a function, you can specify the parameters it expects. When calling the function, you provide the corresponding arguments in the same order as the parameters.

In all the functions of the previous chapters, we used exactly positional arguments - we explicitly indicated the arguments in the () parentheses, after which we called the function, specifying the arguments in the appropriate order.

We can also specify positional arguments when calling the function using a dictionary using argument name as a keyword and argument value as a value:

If we use this type of specification, we can specify arguments in any order:

This way of setting arguments is preferable, as it increases the readability and interpretability of the code.

question-icon

Which statements are true about the function calls?

Виберіть кілька правильних відповідей

Все було зрозуміло?

Секція 2. Розділ 1
some-alt