Consider the following listList1=[2,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]
Write commands for the following:
i. Add 20 at last
ii. Insert 4 at third position
iii. Sort the elements of the list
iv. Count how many times 6 is available
v. Delete all elements from 3rd to 9th position
vi. Delete 11 from the list
vii. Search the position of 13 in the list
viii. Find the maximum value of the list
ix. Find the length of the list
x. Delete all the elements of the list
Answers
Answered by
2
- list1.append(20)
- list1.insert(3,4)
- list1.sort()
- list = list1.count(6)
- del list1[3:9]
- list1.remove(11)
- list = list1.index(13)
- list = max(list1)
- list = len(list1)
- list1.clear()
Similar questions