Advertisements
Advertisements
Question
What is the difference between default Parameters and positional parameters in Python?
Distinguish Between
Advertisements
Solution
| Default Parameters | Positional Parameters | |
| 1. | These are parameters that have a predefined value assigned in the function header. | These are parameters that must be passed in the correct order during a function call. |
| 2. | If no value is provided by the caller, the function uses the default value. | The caller must provide a value for every positional parameter; otherwise, an error occurs. |
shaalaa.com
Is there an error in this question or solution?
