Python > Assignment #4: Catalogue 3.0

Deadline: Wed 19. 10. 2016, 07:47 CET

Note: Python tutorial on data structures should be a useful reference for this assignment, in addition to (as of yet missing) lecture slides. We’ve covered most of it’s content.

Note: You may also wish to consult last week’s exercises (with solutions and comments), or the first or second assignments, that now also contain solutions.

Assignment [2pts]: Write an improved cataloguing script that can bring some order even into larger amounts of data. Read names from keyboard line-by-line; when a blank line is entered, output the names grouped by the surname and exit. Use ascending alphabetical order for both names and surname.

Enter names, one per line; a blank line signals the end of the list:
> Adam Green
> Bob Gray
> Charles Black
> Daniel Blue
> Emily Black
> Rodney Green
> Helen Green
>

 Catalogue listing:
   Black: Charles, Emily
   Blue: Daniel
   Gray: Bob
   Green: Adam, Helen, Rodney

Save your strength: assignment says nothing about middle names or capitalization.