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 transcription text
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
Unlock full access to Course Hero
Explore over 16 million step-by-step answers from our library
Subscribe to view answerrisus 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