Question: Describe the new file created by the program: def main(): countries = PlaceDataIntoList (UN.txt) countries.sort (key=bypop, revrse=True) createFile(countries) def placeDataIntoList(fileName): countries = [] infile =

 Describe the new file created by the program: def main(): countries

Describe the new file created by the program: def main(): countries = PlaceDataIntoList ("UN.txt") countries.sort (key=bypop, revrse=True) createFile(countries) def placeDataIntoList(fileName): countries = [] infile = open (filename, 'x') for line in infile: line = line split(', ') if line[1] == "Europe": countries .append (list (line[0], eval (line[2])))) infile.close() return countries def bypop (country): return country[1] def createFile = (countries): outfile = open ("EuropeByPop.txt", 'w') for country in countries: outfile.write (country[0] + ', '+str(country[1]+" ") outfile close() main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!