Practice Updating and Deleting Elements - 8.3 | Lists in Python | Python Programming Language
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

Updating and Deleting Elements

8.3 - Updating and Deleting 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

How do you change an element in a list?

💡 Hint: Think about how we reference items in a list.

Question 2 Easy

What happens if you try to access an index after deleting it?

💡 Hint: Remember what we discussed about list indexing.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What will happen if you execute del colors[0]?

Removes the first item from the list.
Adds an item to the list.
Clears the entire list.

💡 Hint: Think about what delete operations do.

Question 2

Can you update a list element using a negative index?

True
False

💡 Hint: Negative indexing counts from the end of the list.

1 more question available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Create a list of at least five different fruits. Update the third fruit to 'grape' and remove the first fruit. Show the final list.

💡 Hint: Remember how to refer to the indices.

Challenge 2 Hard

You have a list of numbers. Write a program that updates the last number to 10 and removes the second number. What will the resulting list be?

💡 Hint: Use negative indexing for the last item.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.