Computer Science, asked by dapoda38, 4 months ago

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 anishasa
2
  1. list1.append(20)
  2. list1.insert(3,4)
  3. list1.sort()
  4. list = list1.count(6)
  5. del list1[3:9]
  6. list1.remove(11)
  7. list = list1.index(13)
  8. list = max(list1)
  9. list = len(list1)
  10. list1.clear()

Similar questions