Advertisements
Advertisements
प्रश्न
What will be the output of the following code segment:
myList = [1,2,3,4,5,6,7,8,9,10]
del myList[3:]
print(myList)एका वाक्यात उत्तर
Advertisements
उत्तर
The statement in line 2 will delete the elements from index 3 to the last index of the list. Therefore, the output will be [1, 2, 3].
shaalaa.com
Lists Manipulation in Python
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
