python [-1,2] code example Example: python [:-1] data.append(line[:-1]) #slices the line until last element (\n for example)