List and List Methods
✕Basic Operations
Question 1 of 2
- Store student info as:
[[name_1, age_1], [name_2, age_2], ...]. Display 2nd student's age. total,average,highestandlowestmarks obtained by student- Change name of 2nd subject (1st index) to
Pythonand display updated list - Marks obtained in subject at
3rd position(2nd index) asMark obtained in English is 89 - Marks obtained in subject at second last position with similar format as above.
- Marks obtained in last two subjects
- Marks in first three subjects
- Name of subject in which student scored highest marks
- Name of subject in which student scored lowest marks
- Number of subjects in which student scored 80
Assign marks in five subjects tomark_listand subject names insubject_list. Display:- Store student info as:
Modifying List
Question 2 of 2
- Find the position of first occurrence of
harry_potter - Remove the first occurrence of
harry_potterand display the list - Ask user for a book name and check if its present in list
- Add
the_hobbitto the end of list and display it - Insert
game_of_thronesat index 2 and display the list - Count and display how book for
lord_of_ringsis present in the list - Remove book from 2nd position. Display removed book and original list
- Display the total number of books in the list
- Display all books of list separated by comma
- Assign
book_2as [math,science,history]. Add all books from it to above list and display. - Sort the list in descending order based on length of book name and display result.
Books details are stored as [harry_potter,lord_of_rings,harry_potter, ...]- Find the position of first occurrence of
