In addition to Paul’s response, also check this thread which discusses why we are using range(1, L).
range(1, L)
Best, Saif.