""" function findCity(list of cities, target city) for eachcity in list of cities if eachcity is the targetcity return True return False """ def findCity(listOfCities, target): for oneCity in listOfCities: if oneCity == target: return True return False #We need extractCities() for this to work properly def extractCities(): fin = open("IA_population_data.txt","r") header = fin.readline() allCities = [] for oneLine in fin: data = oneLine.split("\t") city = data[0] allCities.append(city) return allCities