CBSE Class 12 Computer Science
Question 32 of 103
Working with Functions — Question 8
Back to all questions 8
Question Which of the following is not correct in context of Positional and Default parameters in Python functions ?
- Default parameters must occur to the right of Positional parameters.
- Positional parameters must occur to the right of Default parameters.
- Positional parameters must occur to the left of Default parameters.
- All parameters to the right of a Default parameter must also have Default values.
Positional parameters must occur to the right of Default parameters.
Reason — The positional parameters must occur to the left of default parameters because in a function header, any parameter cannot have a default value unless all parameters appearing on its right have their default values.