Soru
What is the result of the following code? my_(-)list=[1,2,3] my list.extend([4, 5]) print(my_list) Error [1,2,3,4,5] [1,2,3,[4,5]] [1,2,3,4]
Çözüm
4.3
(248 Oylar)
Hacer
Usta · 5 yıl öğretmeni
Uzman doğrulaması
Cevap
The correct answer is:
Explanation: The code first creates a list named
with elements
. Then, it uses the extend method to add the elements
to the end of the list. The extend method adds elements to the end of the list, so the final result is
.