Length and Iteration Methods
📖 Scenario: Imagine you are building a small program to manage a list of books in a digital library. You want to store book titles, count how many books there are, and display each book title one by one.
🎯 Goal: You will create a list of book titles, calculate the total number of books using len(), iterate through the list using a for loop, and print both the titles and the total count.
📋 What You'll Learn
Create a list called
books with the given titlesUse the
len() function to count the number of booksUse a
for loop to iterate through the listPrint each book title and the total number of books
💡 Why This Matters
🌍 Real World
Managing lists of items, like books, products, or tasks, is common in many jobs and daily life.
💼 Career
Understanding how to count and loop through lists is a basic skill for programming jobs, data handling, and automation.
Progress0 / 4 steps