Calling Function with Default Arguments :-
Default arguments वाले function को call करते समय हम argument दे भी सकते हैं और छोड़ भी सकते हैं। यदि argument नहीं दिया जाता, तो default value उपयोग होती है।
in English
When calling a function with default arguments, we may provide an argument or omit it. If the argument is omitted, the default value is used.
Example 1: Calling Without an Argument
Output: Course: O Level
Explanation: Argument नहीं दिया गया, इसलिए default value "O Level" का उपयोग हुआ।
Example 2: Calling With an Argument
Output:
Course: Python
Explanation: "Python" argument देने के कारण default value "O Level" की जगह "Python" का उपयोग हुआ।
Example 3: Calling With and Without Arguments
Output:
Explanation:
calculate_square() में default value 5 उपयोग हुई।
calculate_square(4) में 4 उपयोग हुआ।
calculate_square(10) में 10 उपयोग हुआ।