पायथन डिफ़ॉल्ट पैरामीटर मान
डिफ़ॉल्ट पैरामीटर मान
निम्न उदाहरण दिखाता है कि डिफ़ॉल्ट पैरामीटर मान का उपयोग कैसे करें।
यदि हम बिना तर्क के फ़ंक्शन को कॉल करते हैं, तो यह डिफ़ॉल्ट मान का उपयोग करता है:
उदाहरण
def my_function(country = "Norway"):
print("I am from " +
country)
my_function("Sweden")
my_function("India")
my_function()
my_function("Brazil")