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[:5]
print(myList)एक पंक्ति में उत्तर
Advertisements
उत्तर
The statement in line 2 will delete the elements from start (index 0) to index 4 of the list. Therefore, the output will be [6, 7, 8, 9, 10].
shaalaa.com
Lists Manipulation in Python
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
