in reply to Re: Using map function to print few elements of list returned by sort function
in thread Using map function to print few elements of list returned by sort function

Thank you for the comment. My apologies for the confusion. The objective was to print top 4 populated cities for each country. The sample data has 2 countries present ZM and ZW. Each country has many cities listed.

So I would like to print just the top 4 populated cities for each of them. If a country does not have 4 cities as in the case of ZM then print all lines.

  • Comment on Re^2: Using map function to print few elements of list returned by sort function