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:
Speed of boat is 15 km/hr. Speed of the stream is 20% less than speed of boat. Then find time taken by boat to go 108 km downstream?
A man row a boat 1 km in 5 min, along the stream and 6 km in 1hrs against the stream, The speed of the stream will be
Ratio of speed of boat in downstream and speed of stream is 5:2, if speed of current is 4 km/hr, then find distance travelled (in km) upstream in 6 hours.