Post

Sergei Kotov
Sergei Kotov@kotov_dev·
@Python_Dv Tuples are immutable, but their contents are not. Thus, 5 will be appended to the inner list. Answer: A. (1, 2, [3, 4, 5])
English
0
0
0
322
Othieno Michael Edwards
Othieno Michael Edwards@EdwardsOthieno·
@Python_Dv 1. Interesting, there is a mutable data type within an immutable data type 2. Index [2] accesses the third element in our turple which happens to be the list so the turple will be modified (1, 2, [3, 4]). The append function will add 5 into the list 3. Output will be A.
English
0
0
0
255
Prem Prakash
Prem Prakash@4EverPrem·
@Python_Dv 1 t is a tuple which is normally immutable. But it's one of the elements is a list which is mutable. Here we are appending to the list inside tuple which is possible, therefore, output is (1, 2, [3, 4, 5])
English
0
0
0
267
Paylaş