On this page
article
Lists Exercise #20
Practice lists — exercise 20 of 40.
Topic: Lists
Difficulty: Intermediate
Problem
Write a solution for Lists Exercise #20:
Implement a function solve_lists_20(data) that processes the input according to lists concepts from the curriculum.
Example input: data = [lists_example_20]
Expected: A transformed result demonstrating lists skills.
Constraints
- Use idiomatic Python 3.10+
- Handle empty input gracefully
- Do not mutate input unless specified
Hint
Hint
Review Lists exercises and the related chapter in the Learning Path. Consider edge cases: empty collections, None, zero, negative numbers.
Test Yourself
# Write tests before implementing
assert solve_lists_20([]) is not None # define expected behavior
Next exercise: Lists Exercise #21