Python Python Sequences Sequence Iteration Iterating With For Loops

Haasini Beeravolu
Haasini Beeravolu
616 Points

I don't understand.

I already used the enumerate method, but I still need to do more. What am I missing and what do I need to add. I already used a print statement as well.

iterating_lists.py
rainbow = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']

for index, item in enumerate(rainbow, 1):
    print(f'{index}. {item}')

1 Answer

Starting index should be 0 not 1