#!/usr/bin/python # # This program expects the # file List.txt to exist # file = open('List.txt', 'r') shoppingList = file.readlines() print shoppingList[0] print shoppingList[2] print """Note each item in the list produced by readlines() contains a newline character """ Credit = """ By David MacKay. Adapted from http://www.ibiblio.org/obp/pyBiblio/ """