CBSE Class 11 Computer Science
Question 50 of 104
List Manipulation — Question 3
Back to all questions 3
Question Question 3
Start with the list [8, 9, 10]. Do the following using list functions:
- Set the second entry (index 1) to 17
- Add 4, 5 and 6 to the end of the list
- Remove the first entry from the list
- Sort the list
- Double the list
- Insert 25 at index 3
Answer
listA = [8, 9, 10]
- listA[1] = 17
- listA.extend([4, 5, 6])
- listA.pop(0)
- listA.sort()
- listA = listA * 2
- listA.insert(3, 25)