Question:

State True or False:
While defining a function in Python, the positional parameters in the function header must always be written after the default parameters.

Show Hint

Always remember that positional arguments must come before default arguments in a function definition in Python.
Updated On: Jan 21, 2025
Hide Solution
collegedunia
Verified By Collegedunia

Solution and Explanation

In Python, the positional parameters must always appear before the default parameters in the function definition. This is because Python relies on the position of arguments for mapping to function parameters. If default parameters were placed before positional ones, it would create ambiguity in argument mapping.
Was this answer helpful?
0
0

Top Questions on Commands and Requests

View More Questions