Welcome back. Now that you know a little bit about the basics of working with CSV files, it is time for you to solve a problem using them. Here, we have a CSV file, which shows export data for 218 countries. The columns are the country name, the main export, and the total value of their exports in 2014 in US dollars. A problem you might want to solve with this data, is to find which countries export a particular item. For example, you might want to print all of the countries which export lobsters, or all of the countries which export iron. There's a lot of data in this file, way too much to look at by hand, which would be tedious and error prone. Instead, you would rather write a program to perform this analysis for you. As always, we will walk through how you write such a program using the seven steps. Step one is to work a small instance of the problem by hand. Here, we've cut the table down to four countries and only listed a few exports for each of them. Which of these countries exports coffee? After looking at the table for a few seconds, you can see that Madagascar and Malawi export coffee, and Macedonia and Malaysia do not. Next, you need to write down what you just did. If you just say, I just looked at it and saw the answer, that will not help for step three. Instead, you need to think through what you did in a more step-by-step fashion. How did you look at the table and see the answer? You probably looked at the first row's exports column and saw that it did not contain coffee. Next, you looked at the second row's export column and saw that it contains coffee. So, you wrote down Madagascar. Next, you looked at the third row's export column and saw that it also contains coffee, so you wrote down Malawi. Finally, you looked at the forth row's exports column, and saw that it did not contain coffee. Thinking through this in a step-by-step fashion leads to these ten steps for this particular instance of a problem. Now, we're ready to look for patterns and generalize. Notice how you are doing very similar things for each row. This similarity suggests you will eventually want to loop over each row. However, there are some differences in the steps for each row that you need to think through before you can express this algorithm in terms of for each row. The first difference you might notice is that on line five you wrote down Madagascar, and on line eight, you wrote down Malawi. Where did these particular words come from? They are the value of the country column for the row you are looking at. The next difference you might notice, is that you do not write down the country for the first and fourth rows, but you do for the second and third. How did you know whether to write the country down or not? You made this choice based on whether or not the row contained coffee in the Exports column. Now that you have figured out how to operate on each row in the same way, you can write down the generalized steps in terms of for each row in the CSV file, generalizing over how many rows the file has. Now that you have a general algorithm to solve this problem, it is time to test it out. Here is a table of data which contains two countries. Use the algorithm to find out which ones export lobster. Is this algorithm correct? According to our algorithm, Brazil is the country which exports lobster. Oops, that's not correct. We should have gotten Angola. Did you test the algorithm carefully enough to notice this mistake? The problem is that our algorithm always checks for coffee, not for whatever expert we are interested in. We should have thought this through as we generalized, but we missed doing that. This is exactly the sort of problem step four, testing your algorithm is intended to catch before you write code. You can fix this algorithm by referring to the parameter, we'll call it exportative interest, which indicates which export you want to look for. Making this correction to the algorithm will have it yield the right answer on this test case. Now that you have an algorithm, it's time to write the code.