Use a list comprehension with a filter to keep only the words from the list that have more than 4 ch
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
Problem
Use a list comprehension with a filter to keep only the words from the list that have more than 4 characters. The words are: ['cat', 'elephant', 'dog', 'butterfly', 'ant', 'giraffe']. Print the result.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.