Explanation:
✅ Function Definition:
-
This defines a function called add with two parameters:
a (required)
b (optional with a default value of 2)
✅ Function Body:
-
This returns the sum of a and b.
✅ Function Call:
add(3) means:
-
a = 3
b is not provided, so the default value 2 is used
-
The function returns 3 + 2 = 5
So the output is:
✅ Final Output:


0 Comments:
Post a Comment