Continue with your mobile number
In Python, arguments are passed to functions using pass-by-object-reference , a hybrid approach where the behavior depends on the object’s mutability. For mutable objects (e.g., lists, dictionaries), functions can modify the object directly, as the reference points to the same memory location. For immutable objects (e.g., integers, strings), any attempt to modify them results in a new object being created, leaving the original object unchanged. For example: def modify_list(lst): lst.append(4) my_list = [1, 2, 3] modify_list(my_list) print(my_list) # Output: [1, 2, 3, 4] In the case of immutables: def modify_int(x): x += 1 num = 5 modify_int(num) print(num) # Output: 5 This illustrates that Python’s approach is neither traditional pass-by-value nor pass-by-reference. Why Other Options Are Incorrect:
निम्नलिखित प्रश्नों में छह वाक्य S1, S6, P, Q, R और S के रूप में संक...
निम्नलिखित में से एक वर्तनी शुद्ध है-
'निशाचर' का अर्थ समाहित नहीं है
निम्नलिखित में से कौन सा सही सुमेलित युग्म नहीं है
<...निम्नलिखित शब्दों में 'सूर्य' के तीन पर्यायवाची विकल...
' पराजय ' किसका विलोम शब्द है ?
अस्वस्थ(1) / शिथिल(2) / हो जाते है।(3) मनुष्य (4)
इस वाक्...
सूची 1 को सूची 2 से सुमेलित कीजिए और सूचियों के नीचे दिए गए ...
‘ तुम प्रतिदिन खेलते हो ‘
उपर्युक्त वाक्य में प्रतिदि...
निम्नलिखित में से कौन सी क्रिया प्रेरणार्थक है?