# zoo # open the Variables window from the Thonny view menu the_file = open('zoo.txt','r') animals = the_file.readlines() # animals is now a list. Check the variables window # print(animals) to see it the_file.close() for line in animals: line = line.strip('\n') print(line) # or you can append the line to a new empty list for # further processing. # Challenge # set up a new empty list # add the animals to the list (no newline character) # use len to find out how many animals there are in the list # use integer division to find the median // # Use index positions and slicing to display(print) the first half # of the list only # set up 2 new lists for the two halves of the animals list # split the main animals list into 2 # loop over the new lists and write them to 2 new text files # with suitable names