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...
This question has been answered
Question

INSTRUCTIONS :1) Python Programming 2) No use use of built in libraries and built in functions

3) Use comment out for understanding better.

4) Use Functions name and parameter name is same as given in question.

image_2021-02-05_234938.png

Image transcriptions

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) : // your 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

Answered by Expert Tutors
amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum v
Step-by-step explanation
16304970
lestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur lao
1 Attachment
g92.png
png
Get unstuck

483,215 students got unstuck by Course
Hero in the last week

step by step solutions

Our Expert Tutors provide step by step solutions to help you excel in your courses