Lesson 23 of 34
Default और Keyword Arguments
8 min 30 XP
किसी parameter को default मान दें। बुलाने वाला उसे न दे, तो 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: मान नाम से भेजें, तब क्रम मायने नहीं रखता। कोड पढ़ना भी आसान हो जाता है।
Example: edit me and press Run
Output Loading Python (first time takes a few seconds)
Press Run to see the result here.default वाले parameters, बिना default वालों के बाद आते हैं: def f(a, b=2) ठीक है, def f(a=1, b) error है।