i = vec[0] if sentence_lengths[i]==0: # First end symbol has not been found yet sentence_lengths[i] = vec[1] # Position of first end symbol the above index i should be replaced by another j index.
i = vec[0]
if sentence_lengths[i]==0: # First end symbol has not been found yet
sentence_lengths[i] = vec[1] # Position of first end symbol
the above index i should be replaced by another j index.