Practice Modifying List Elements - 20.5 | 20. LIST – Python Data Structures | CBSE Class 9 AI (Artificial Intelligence)
K12 Students

Academics

AI-Powered learning for Grades 8–12, aligned with major Indian and international curricula.

Professionals

Professional Courses

Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.

Games

Interactive Games

Fun, engaging games to boost memory, math fluency, typing speed, and English skills—perfect for learners of all ages.

Practice Questions

Test your understanding with targeted questions related to the topic.

Question 1

Easy

Modify the list fruits = ["apple", "banana"] to change 'banana' to 'pear'.

💡 Hint: Use indexing to access the second item in the list.

Question 2

Easy

How would you change the first item in scores = [98, 85, 75] to a score of 100?

💡 Hint: Remember that the first index is 0.

Practice 4 more questions and get performance evaluation

Interactive Quizzes

Engage in quick quizzes to reinforce what you've learned and check your comprehension.

Question 1

What will fruits[1] = 'grapes' do in the list fruits = ['apple', 'banana', 'mango']?

  • It adds grapes to the end of the list.
  • It changes banana to grapes.
  • It removes the second element.

💡 Hint: Think about how indexing works.

Question 2

True or False: You can modify a list in Python by just assigning a new value to an index.

  • True
  • False

💡 Hint: Remember what it means for a list to be mutable.

Solve and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

Given a list my_numbers = [2, 4, 6, 8, 10], create a new list that doubles each element.

💡 Hint: Use list comprehension to achieve this.

Question 2

How can you modify the list names = ["John", "Jane", "Doe"] to change 'Doe' to 'Smith', and print the updated list?

💡 Hint: Locate the index of 'Doe' to make the change.

Challenge and get performance evaluation