Answers for "python positional argument"

1

python positional argument

A function definition may look like:

def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):
      -----------    ----------     ----------
        |             |                  |
        |        Positional or keyword   |
        |                                - Keyword only
         -- Positional only

where / and * are optional.
If used, these symbols indicate the kind of parameter by how
the arguments may be passed to the function:
      positional-only, positional-or-keyword, and keyword-only.
Keyword parameters are also referred to as named parameters.
Posted by: Guest on June-28-2020

Code answers related to "python positional argument"

Python Answers by Framework

Browse Popular Code Answers by Language