Explanation: Breakdown of the solution Overview The solution displays the last elements of the requested lists, then creates a line chart from the corresponding data before showing it on screen. It thus meets all the requirements of the exercise. Step-by-step walkthrough The instructions print(gdp_cap[-1]) and print(life_exp[-1]) respectively display the last element of each list, corresponding to the data for Zimbabwe. The [-1] indexing allows direct access to the last element of a list. The command plt.plot(gdp_cap, life_exp) creates a line chart representing GDP per capita on the x-axis and life expectancy on
The rest of this lesson is reserved for subscribers Create your free account to try the sample exercises, then upgrade to full access whenever you like.