Anasayfa
/
Teknoloji
/
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]]

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
Uzman doğrulaması
Usta · 5 yıl öğretmeni

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 .