Counting Specific Items in a Fruit Basket
๐ Scenario: Imagine you have a basket full of different fruits. You want to find out how many apples are in the basket.
๐ฏ Goal: You will write a program that counts how many times the fruit 'apple' appears in a list of fruits.
๐ What You'll Learn
Create a list called
fruits with specific fruit namesCreate a variable called
target_fruit to hold the fruit name to countUse a
for loop to count how many times target_fruit appears in fruitsPrint the count with a clear message
๐ก Why This Matters
๐ Real World
Counting specific items in a list is useful in many real-life situations, like counting votes, inventory items, or survey answers.
๐ผ Career
This skill helps in data analysis, quality control, and any job that requires summarizing or searching through data.
Progress0 / 4 steps