Lesson 23 of 34
Default, Keyword Arguments
8 min 30 XP
Parameter-ന് ഒരു default value നൽകൂ. Caller അത് നൽകിയില്ലെങ്കിൽ default ഉപയോഗിക്കും.
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.Keyword arguments: values പേര് ഉപയോഗിച്ച് നൽകൂ, അപ്പോൾ ക്രമം പ്രശ്നമല്ല. കോഡ് വായിക്കാനും എളുപ്പമാകും.
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.Default ഉള്ള parameters ഇല്ലാത്തവയ്ക്ക് ശേഷം വരണം: def f(a, b=2) ശരി, def f(a=1, b) error ആണ്.