Why was f not included? Confused about it

Why is it impossible to assign value to f?

Hey @Nitin-Bhattacharyya-2319140631658033, let me explain this with the help of an example. Also to mention explicitly sir has mentioned that this was impossible to assign value to f in c/java. For python we handle it using args and kwargs covered later in video.

Eg. suppose there is a function named calculate_interest(pricipal_amount, years = 5, rate).
Now if you want to call this function passing only two parameters, then it will ambiguous and compiler will get confused if the second value is years or rate. Also if you someone counter to say this, that I will always pass three values to the function, then there is no use left for defining default values.

Also this will become more worse if rate is followed by another default parameter. So that’s the reason we can’t have non default parameters after default parameters.

Hope this resolved your doubt. :blush:

Thanks for resolving the doubts so clearly

Hey @Nitin-Bhattacharyya-2319140631658033, You’re welcome. You are requested to close the doubt as well in my doubts section. :blush: