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

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

Modifying List Elements

20.5 - Modifying List Elements

Enroll to start learning

You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.

Learning

Practice Questions

Test your understanding with targeted questions

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.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

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.

Get performance evaluation

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

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.

Challenge 2 Hard

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.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.