+ 3

About i

What is i in , for i in range(5): ??? actually I tried ever letters(small and big) and they worked the same.. what is it's purpose??

5th Jun 2017, 2:06 PM
Darwin Cantong
Darwin Cantong - avatar
5 Answers
+ 15
No purpose, it's just the variable's name. You can rename it to anything....
5th Jun 2017, 2:15 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 4
i is usually used standing for index and/or iterator... you could also encountered c for count, n as it's relatively common in mathematical context, and any other semantically appropriate to the context ^^
5th Jun 2017, 4:42 PM
visph
visph - avatar
5th Jun 2017, 3:35 PM
Mario L.
Mario L. - avatar
+ 1
i mean index (at least I use i as that meaning)
5th Jun 2017, 2:35 PM
James Lapez
- 1
Like others said it's a variable's name used as an iterator/index in bucles like For, Do.. While or While. You can rename it to any valid name you want. Other common names used are c, j, k, n, x, y, z.
28th Jun 2017, 9:09 AM
Ismail
Ismail - avatar