Array basics
📖 Scenario: You are organizing a small fruit basket. You want to keep track of the fruits you have using an array.
🎯 Goal: Create an array of fruits, count how many fruits you have, and print the list and the count.
📋 What You'll Learn
Create an array called
fruits with exactly these values: "Apple", "Banana", "Cherry"Create a variable called
count that stores the number of fruits in the fruits arrayUse a
for loop with variable fruit to iterate over the fruits arrayPrint each fruit inside the loop
After the loop, print the total count of fruits using the
count variable💡 Why This Matters
🌍 Real World
Arrays are used to store lists of items like fruits, names, or numbers in many programs.
💼 Career
Understanding arrays is essential for programming jobs because they help organize and manage data efficiently.
Progress0 / 4 steps
