# CSE-160-D01_2024FA_Intro-to-for-Statements_0001.py
# Introduction to Python 'for' Statements
# Python 'for' statements implement "looping" in Python. In "looping" one uses 'for' statements 
# to execute a section of their code repeatedly (or iteratively) usually advancing some 
# control variable until some expression becomes false.

for i in [1, 2, 3, 4, 5]:
    print(f"i = {i}, i squared = {i**2}")

print("\n*******************************************\n")

myLstVar1 = ["Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"]
print("The third color in the list is: ", myLstVar1[2])

print("\n*******************************************\n")

for eachColor in myLstVar1:
    print(eachColor)

print("\n*******************************************\n")

print("myLstVar1 contains ", len(myLstVar1), " items.")
for i in range(len(myLstVar1)):     # "range(n)" gives you series of numbers from 0 ... n-1
    print(i, myLstVar1[i])
