Post

Coding Computing Coach
Coding Computing Coach@CodingComputing·
@Python_Dv Answer: C Solution: `a` and `b` are lists with values [1,2,3] and [4,5] respectively. a.extend(b) applies the list method `extend` to `a`, with `b` as argument. What does this method do? It changes the list `a`, by appending to it all items from `b`. Thus, +
English
0
0
0
343
Prem Prakash
Prem Prakash@4EverPrem·
@Python_Dv 5. Extend list by appending elements from the iterable, so the new list a => [1, 2, 3, 4, 5], thus length = 5 If append is used instead of extend, then a = [1, 2, 3, [4, 5]] and length would be 4
English
0
0
0
90
Rakesh Das
Rakesh Das@RakeshDas_18·
@Python_Dv C. 5 is the output. Reason: 1. a = [1, 2, 3] and b = [4, 5]. 2. The extend() method appends the elements of b to the end of a, resulting in the combined list [1, 2, 3, 4, 5]. 3. The len(a) function returns the length of this combined list, which is 5. Thus, the output is 5.
English
0
0
0
108
Daniel Zadva, Jnr.
Daniel Zadva, Jnr.@zad_va·
@Python_Dv The CORRECT Answer is C. 5 This is because the statement a.extend(a) extends the list a, therefore, the length of the list will be 5.
English
0
0
0
10
Paylaş