from time import * def main(): director = { 'Star Wars':'George Lucas', 'The Godfather' : 'Francis Ford Coppola', 'American Graffiti' : 'George Lucas'} # get the list of movie titles, sort them and display them titles = director.keys() titles.sort() print 'get the list of movie titles, sort them and display them' print titles,'\n' sleep(1) # print all keys of the dictionary 'director' print 'print every elements of the dictionary \'director\'' for entry in director: print entry print sleep(1) # print the sorted list of directors print 'print the sorted list of directors' for person in sorted(director.values()): print person,'is a director' print sleep(1) # iterate over (key,value) pairs and display them print 'iterate over (key,value) pairs and display them' for movie,person in director.items(): print movie,'was directed by',person+'.' print main()