0

Give explanation to this practical question

PRACTICE EXERCISE Imagine you're creating content for a vocabulary-building app. You want to challenge users by showing them only the longer words from a provided list.

12th May 2024, 8:53 AM
ZNM Begum
ZNM Begum - avatar
3 odpowiedzi
+ 1
What do you mean? Do you not understand the task? You need to check the length of the words and then only select the longer ones to output.
12th May 2024, 11:35 AM
Ausgrindtube
Ausgrindtube - avatar
0
This is the answer words = ["tree", "button", "cat", "window", "defenestrate"] # Use a list comprehension to filter out words longer than four letters long_words = [word for word in words if len(word) > 4] # Display the filtered list print (long_words)
1st Jun 2025, 4:32 AM
Elias antonio Felix moncada