Use enumerate() to loop over the list fruits
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
Problem
Use enumerate() to loop over the list fruits. For each fruit, print the 1-based index and the fruit name in the format '1. apple' (use start=1). Print one item per line.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.