Practice Common List Functions (12.2.7) - Manipulating lists - Data Structures and Algorithms in Python
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

Common List Functions

Practice - Common List Functions

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

What does the append() method do?

💡 Hint: Think about how you can grow a list.

Question 2 Easy

Explain what happens if you try to remove an item that does not exist in the list.

💡 Hint: What type of error is raised in Python?

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What does the extend() method do?

Adds a single item
Adds multiple items from another iterable
Removes an item

💡 Hint: What method is used to combine two lists?

Question 2

True or False: The remove() method can delete multiple occurrences of a value at once.

True
False

💡 Hint: Consider how many items are affected by a single function call.

2 more questions available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Implement a function filter_list(lst, value) that removes all instances of value from the list lst, then returns it. Ensure to handle empty lists and lists with no occurrences of value gracefully.

💡 Hint: Use a loop to keep checking for the value until it is no longer in the list.

Challenge 2 Hard

Create a list manipulation program that accepts user input to add or remove elements, allowing the user to choose multiple operations until they opt-out. Display the current list after each operation.

💡 Hint: Consider how to use conditional statements to control the flow.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.