Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using python Function name (6):sort films Return value N/A Description: Using top500.txt which contains the name and lifetime gross revenue of the top 500 films.

using python

image text in transcribed

image text in transcribed

Function name (6):sort films Return value N/A Description: Using "top500.txt" which contains the name and lifetime gross revenue of the top 500 films. Each line of the given file is formatted like so: These movies are not in order. Write a function called 'sort films' that accepts two parameters: a string of a source filename and a string of a destination filename. Your function should open the source file and sort the contents from greatest gross revenue to least gross revenue, and write the sorted contents to the destination filename. You may assume the source file is correctly formatted. sort films("top5ee.txt", "top5eeresult.txt") The top 20 results (your file should have all 58e) should look like this Star Wars: The Force Awakens 936662225 Avatar 760507625 Titanic Jurassic World 652278625 Marvel's The Avengers 62335791e The Dark Knight 534858444 Rogue One: A Star Wars Story 530748532 Finding Dory 486295561 Star Wars: Episode I The Phantom Menace 474544677 Star Wars 460998807 658672382

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions