Computer Science, asked by rohitthakur62790, 3 months ago


Consider the following list-       6


   List1=[2,3,5,6,7,8,9,10,11,12,13,14,15,16,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


        ​

Answers

Answered by vijayakumarchinthala
2

Answer:

(i) list1.append(20)

(ii)list1[3]=4

(iii)list1.sort()

(iv) list1.count(6)

Explanation:

append adds only one element in the last

indexing is used to add element

sort method display the elements in order

count method counts number of occurrence of the element

Similar questions