Python List Programs Questions
Q1: Make a program to perform following operation on the list –
marks = [78,87,89,67,56]
1. Add 98 at the end of the list.
2. Add 46 at the 3rd Position in the list
3. Remove 87 from the list
4. Determine the index of 67 in the list
5. Sort the marks in descending order
Q2: Make a program to perform following operation on the list –
names = [‘Ritu’, ‘Divya’, ‘Shruti’, ‘Amit’, ‘Priya’]
1. Sort the names in ascending order.
2. Insert a ‘Divya’ at the 5th position in the list.
3. Delete ‘Ritu’ from the list.
4. Display count of ‘Divya’ in the list.
5. Add [‘Riya’,’Arav’] as individual elements in the list.
6. Add [‘Kriti’,’Preeti’] as a nested list in the list.
Q3: Make a program to perform following operation on the list –
L= [‘mango’, 56, ‘Shruti’, 66.8, ‘Delhi’,100, ’welcome1’]
1. Add 98.5 at the end of the list
2. Insert ‘Singapore’ at the 3rd position in the list.
3. Copy the list from 2nd to 5th position in a newlist
4. Display the newlist.
5. Delete 100 from the list.