Iterating over lists
📖 Scenario: You are helping a small bookstore organize its daily sales data. The store records the number of books sold each day in a list. You will write a simple program to go through this list and work with the sales numbers.
🎯 Goal: Build a program that creates a list of daily book sales, sets a target sales number, counts how many days met or exceeded the target using a loop, and then prints the count.
📋 What You'll Learn
Create a list called
daily_sales with the exact values: 12, 7, 15, 9, 20, 5Create a variable called
target and set it to 10Use a
for loop with the variable sales to iterate over daily_salesInside the loop, count how many days have sales greater than or equal to
targetPrint the final count using
print(count)💡 Why This Matters
🌍 Real World
Counting how many days meet a sales goal helps businesses understand their performance and plan better.
💼 Career
This skill is useful for data analysis, reporting, and automating simple business tasks.
Progress0 / 4 steps