The line numbers in the program don't match the error.
The error is on line 45, not 35
So there are 10 lines of code missing from the listing.
add the following before the 2nd loop
The error is on line 45, not 35
So there are 10 lines of code missing from the listing.
add the following before the 2nd loop
for i in range(0, len(s)): print('Before 2nd loop, i: {}, len(s): {}'.format(i, len(s))) for k in range(0, len(s[i])):and show printout just before failure.