I'm lost - What is 'i'?


#1



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'?


https://www.codecademy.com/courses/python-beginner-nzzVa/3/1?curriculum_id=4f89dab3d788890003000096#

No errors


Replace this line with your code.


#2

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

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