""" func extractCities() open the file read one line to trash header create empty list for the cities for every additional line in the file split the line to get the city add the city to the list return the list """ def extractCities(): fin = open("IA_population_data.txt","r") fin.readline() #throw away the header line cities = [] for line in fin: data = line.split("\t") city = data[0] cities.append(city) fin.close() return cities