I am parsing a list of data from a file I am reading in, and every line ends with a '\n' character. When I try to stop at the end of the line, my while does not stop at the newline character.
while parsed_data[i] is not '\n':
if parsed_data[i] is not '':
temp_data.append(parsed_data[i])
i += 1
The link to a screenshot of how the data I'm looping through is here: http://i.imgur.com/2ycDDDL.png
When the loop gets to the 11th element the loop does not exit, causing it to run for another round and thus increment past the bounds of the list.