List and List Methods

  1. Basic Operations

    Question 1 of 2

    • Store student info as: [[name_1, age_1], [name_2, age_2], ...]. Display 2nd student's age.
    • Assign marks in five subjects to mark_list and subject names in subject_list. Display:
      1. total, average, highest and lowest marks obtained by student
      2. Change name of 2nd subject (1st index) to Python and display updated list
      3. Marks obtained in subject at 3rd position (2nd index) as Mark obtained in English is 89
      4. Marks obtained in subject at second last position with similar format as above.
      5. Marks obtained in last two subjects
      6. Marks in first three subjects
      7. Name of subject in which student scored highest marks
      8. Name of subject in which student scored lowest marks
      9. Number of subjects in which student scored 80
  2. Modifying List

    Question 2 of 2

      Books details are stored as [harry_potter, lord_of_rings, harry_potter, ...]
      1. Find the position of first occurrence of harry_potter
      2. Remove the first occurrence of harry_potter and display the list
      3. Ask user for a book name and check if its present in list
      4. Add the_hobbit to the end of list and display it
      5. Insert game_of_thrones at index 2 and display the list
      6. Count and display how book for lord_of_rings is present in the list
      7. Remove book from 2nd position. Display removed book and original list
      8. Display the total number of books in the list
      9. Display all books of list separated by comma
      10. Assign book_2 as [math, science, history]. Add all books from it to above list and display.
      11. Sort the list in descending order based on length of book name and display result.