ids to build set of dictionaries that each store information about one of the current submissions we set up an empty list called submission_dicts at to store these dictionaries we then loop through the ids of the top submissions we make new api call for each submission by generating url that includes the current value of submission_id we print the status of each request so we can see whether it is successful at we create dictionary for the submission currently being processedwhere we store the title of the submission and link to the discussion page for that item at we store the number of comments in the dictionary if an article has no comments yetthe key 'descendantswill not be present when you're not sure if key exists in dictionaryuse the dict get(methodwhich returns the value associated with the given key if it exists or the value you provide if the key doesn' exist ( in this examplefinallywe append each submission_dict to the list submission_dicts submissions on hacker news are ranked according to an overall scorebased on number of factors including how many times it' been voted uphow many comments it' receivedand how recent the submission is we want to sort the list of dictionaries by the number of comments to do thiswe use function called itemgetter({which comes from the operator module we pass this function the key 'comments'and it pulls the value associated with that key from each dictionary in the list the sorted(function then uses this value as its basis for sorting the list we sort the list in reverse order to place the most-commented stories first once the list is sortedwe loop through the list at and print out three pieces of information about each of the top submissionsthe titlea link to the discussion pageand the number of comments the submission currently hasstatus code --snip-titlefirefox deactivates flash by default discussion linkcomments titlenew horizonsnasa spacecraft speeds past pluto discussion linkcomments titleiran nuclear deal is reached with world powers discussion linkcomments