For loop basics
๐ Scenario: You work in a small grocery store. You have a list of fruit names that you want to check one by one.
๐ฏ Goal: You will write a Go program that uses a for loop to go through a list of fruits and print each fruit's name.
๐ What You'll Learn
Create a slice of strings with exact fruit names
Create a variable to count fruits
Use a for loop with index and value to iterate over the slice
Print each fruit name inside the loop
Print the total number of fruits after the loop
๐ก Why This Matters
๐ Real World
Loops are used to process lists of items like products, names, or data entries one by one.
๐ผ Career
Understanding loops is essential for any programming job because they help automate repetitive tasks efficiently.
Progress0 / 4 steps