0

What is i in range

I don't know but would like to

1st Mar 2019, 1:05 PM
Meer Shah
Meer Shah - avatar
2 odpowiedzi
+ 3
i is just a variable. range is an object that delivers a range of numbers, for example range(10) -> 0123456789. for i in range(10) now just means: with i=0 # code here with i=1... with i=2... with i=3... ... up to the end of the range.
1st Mar 2019, 1:07 PM
HonFu
HonFu - avatar
+ 2
any variable name will do. It doesn't have to be i
1st Mar 2019, 3:28 PM
Ore
Ore - avatar