Start learning 50% faster. Sign in now
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:
Castle term is related to which sport?
Who emerged victorious at the Monte Carlo Masters 2024, defeating Norway's Casper Ruud in the finals?
Who won the ICC cricket world cup in 2016?
In the 2024 Paris Olympics, which badminton player did Lakshya Sen defeat to reach the semi-finals, marking a historic first for an Indian male shuttler?
Which football club claimed the championship in the Kargil District Football League-2024?
Which sport is the term "Doosra" associated with?
Who won the silver medal in the women’s recurve event at the Archery World Cup Final 2024?
Which cricket team won the Ranji Trophy 2023-24 title?
Who won the 26th Lal Bahadur Shastri Hockey tournament in 2015?
Milk is white in colour due to the presence of ______