Iteration using range()
📖 Scenario: You are helping a small bakery count the number of cupcakes they have baked each day for a week. They want to print the day numbers from 1 to 7 to keep track.
🎯 Goal: Build a simple program that uses range() to iterate through the days of the week (1 to 7) and print each day number.
📋 What You'll Learn
Create a variable to hold the total number of days (7)
Use
range() to generate numbers from 1 to 7Use a
for loop with variable day to iterate over the rangePrint each day number inside the loop
💡 Why This Matters
🌍 Real World
Counting days or items is common in many jobs, like tracking sales, attendance, or production.
💼 Career
Understanding how to use <code>range()</code> and loops helps automate repetitive tasks and process lists of data efficiently.
Progress0 / 4 steps