Section 1. Chapter 18
single
Challenge: List Files with Extension
Swipe to show menu
Task
Swipe to start coding
Write a function that filters and prints filenames ending with ".txt" from a given list.
- Loop through each element in the
filenameslist. - Check if the current filename ends with ".txt".
- If it does, print the filename.
Solution
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 18
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat