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.
Practice Questions
Test your understanding with targeted questions
How do you change an element in a list?
💡 Hint: Think about how we reference items in a list.
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
What will happen if you execute del colors[0]?
💡 Hint: Think about what delete operations do.
Can you update a list element using a negative index?
💡 Hint: Negative indexing counts from the end of the list.
1 more question available
Challenge Problems
Push your limits with advanced challenges
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.
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.