0
What role does the following line of code play in for loops?
What role does the following line of code play in for loops? max_index = len(words) - 1
2 Respuestas
+ 2
Please show more context, as this simply assigns the value equal to length of the words object minus 1 to a variable named max_index.
+ 2
Rik Gart This line make for loop to go upto the end element in a array because array index starts with 0 and its sizs start with 1 which is always greter than its index so we decrease it by one to reach to end elemnt of an array