CBSE Class 11 Informatics Practices
Question 51 of 80
Lists in Python — Question 14
Back to all questions[6, 7, 8, 9, 10]
In the given code, myList is initialized as [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]. The del myList[:5] statement deletes all elements in the list from the beginning up to, but not including, index 5. This removes the first five elements (1, 2, 3, 4, 5) from myList. The subsequent print(myList) statement then outputs the modified list, which is [6, 7, 8, 9, 10].