Test Index
Functions in Python
© examsnet.com
Question : 11 of 23
Marks:
+1,
-0
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.
[CBSE 2024 Set 4]
Solution:
Concept:In a function header, parameters without default values (positional / required parameters) must come first, and parameters with default values come after them.Explanation:
def area(l, b=10): # valid return l * bdef area(l=10, b): # SyntaxError: non-default argument follows default argument return l * bSo the statement says the opposite of the rule: positional parameters must be written before the default parameters, never after them. Hence the statement is False.Answer:Option B (False)
© examsnet.com
Go to Question: