I'm lost - What is 'i'?


I'm lost.
Lesson: 12 - Printing out a list item by item in a function

The code
n = [3, 5, 7]
def print_list(x):
__ for i in range(0, len(x)):
__ __print x[i]

it works. But i don't understand why.
what is 'i'? I see random variables in code lessons and i don't understand where this variable comes from.
I just don't get where i is defined or why we can work with it. How does the function know what to do with 'i'?


No errors

Replace this line with your code.


i is a popular convention used to represent an index, or item.

It just stands for the number you are looping through. :slight_smile: