List Assg
List Assg
Q1.Write a program to allow user to perform any those list operation given in
a menu. The menu is:
1. Append an element
2. Insert an element
3. Append a list to the given list
4. Modify an existing element
5. Delete an existing element from its position
6. Delete an existing element with a given value
7. Sort the list in the ascending order
8. Sort the list in descending order
9. Display the list.
Q3. Consider the following list myList. What will be the elements of myList
after each of the following operations?
myList = [10,20,30,40]
a) myList.append([50,60])
b) myList.extend([80,90])
b) myList = [1,2,3,4,5,6,7,8,9,10]
del myList[:5]
print(myList)
c) myList = [1,2,3,4,5,6,7,8,9,10]
del myList[::2]
print(myList)