I'm not sure what I'm doing wrong here? Do I need to treat the \ as a special character? The sequence \r\n appears literally in the string in the txt file I am using.
def split_into_rows(weather_data):
list_of_rows = []
while not (weather_data.find("\r\n") == -1):
firstreturnchar = weather_data.find("\r\n")
row = weather_data[ :firstreturnchar]
list_of_rows = list_of_rows.append(row)
return list_of_rows
What I need is, while there are still examples of the substring \r\n left in the string, to find the first instance of the substring "\r\n", chop everything before that and put it into the variable row, then append row to list_of_rows.