Ad
  • Custom User Avatar

    The i here is just a number, so i+1 is fine. If you had tried to do lines[i+1] then you might run into an issue.

    But also range(0) is empty, so no values are computed for empty lists anyway.

  • Custom User Avatar

    Hi,
    I wrote this code as a starting point but did not expect it to pass all tests.
    I do not understand why it works with empty lists.

    If lines is an empty list, then len(lines)=0.
    So {i+1} should generate an error, shouldn't it ?

    thanks :)