Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

. Tsiimba Mukuumbi, 1894 Cyrus the Great, 530 Bardiya, 522 Xerxes I, 486 Bivula Bangi, 1929 please do it in python data structures ASAP Task

.image text in transcribed

Tsiimba Mukuumbi, 1894 Cyrus the Great, 530 Bardiya, 522 Xerxes I, 486 Bivula Bangi, 1929

please do it in python data structures ASAP

Task 4: Emirates A data set of emperors along with their years they died have been given in a text file attached with this document. Write a function SortEmpire() that takes list of objects of empire. The object consists of empire name and the year. The function should return a python list of containing objects in chronological order. The complete task should be executed in O(n). File Format Each line of the file contains two values N and Y separated by comma. N is the name of the emperors and Y is the year they died. Sample File: Tsiimba Mukuumbi, 1894 Cyrus the Great, 530 Bardiya, 522 Xerxes I, 486 Bivula Bangi, 1929 def SortEmpire (file): youn code goes here Example: print (SortEmpire "emperors.txt #the function should return Xerxes I, 486 Bardiya, 522 Cyrus the Great, 530 Tsiimba Mukuumbi, 1894 Bivula Bangi, 1929

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

Step: 3

blur-text-image

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

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

Write a Python program to check an input number is prime or not.

Answered: 1 week ago

Question

Write a program to check an input year is leap or not.

Answered: 1 week ago