Arrays

A For Loop is an arrays best friend for one reason – The counter!​

Each loop has a counter and every time the loop is completed the counter increases by one.​

This is extremely useful when populating and displaying information. The For Loop allows the program to ask the user a question multiple times and saving the inputs into different Indexes of the array.​  As the counter increases by one each time, it is perfect to use as a reference for the index.

Python Code Example