@@ -92,7 +92,7 @@ The loop variable is now: hippo
9292
9393We are not asking Python to print the value of the loop variable anymore, but
9494the for loop still runs and the value of ` creature ` changes on each pass through
95- the loop. The statement ` pass ` in the body of the loop just means "do nothing".
95+ the loop. The statement ` pass ` in the body of the loop means "do nothing".
9696
9797> ## Challenge - Loops
9898>
@@ -164,7 +164,7 @@ practical, and is very likely to introduce errors into your code. We want to
164164turn what we've just written into a loop that repeats the last two commands for
165165every year in the dataset.
166166
167- Let's start by writing a loop that simply prints the names of the files we want
167+ Let's start by writing a loop that prints the names of the files we want
168168to create - the dataset we are using covers 1977 through 2002, and we'll create
169169a separate file for each of those years. Listing the filenames is a good way to
170170confirm that the loop is behaving as we expect.
@@ -272,7 +272,7 @@ filename = 'data/yearly_files/surveys' + str(year) + '.csv'
272272
273273Let's break down the parts of this name:
274274
275- * The first part is simply some text that specifies the directory to store our
275+ * The first part is some text that specifies the directory to store our
276276 data file in (data/yearly_files/) and the first part of the file name
277277 (surveys): ` 'data/yearly_files/surveys' `
278278* We can concatenate this with the value of a variable, in this case ` year ` by
@@ -315,8 +315,8 @@ the local variable hides but doesn't overwrite the other.
315315
316316Every method used in Python (for example, ` print ` ) is a function, and the
317317libraries we import (say, ` pandas ` ) are a collection of functions. We will only
318- use functions that are housed within the same code that uses them, but it's also
319- easy to write functions that can be used by different programs.
318+ use functions that are housed within the same code that uses them, but
319+ we can also write functions that can be used by different programs.
320320
321321Functions are declared following this general structure:
322322
@@ -416,7 +416,7 @@ do what you expect?
416416
417417What we really want to do, though, is create files for multiple years without
418418having to request them one by one. Let's write another function that replaces
419- the entire ` for ` loop by simply looping through a sequence of years and repeatedly
419+ the entire ` for ` loop by looping through a sequence of years and repeatedly
420420calling the function we just wrote, ` one_year_csv_writer ` :
421421
422422
@@ -456,7 +456,7 @@ yearly_data_csv_writer(1977, 2002, surveys_df)
456456BEWARE! If you are using IPython Notebooks and you modify a function, you MUST
457457re-run that cell in order for the changed function to be available to the rest
458458of the code. Nothing will visibly happen when you do this, though, because
459- simply defining a function without * calling* it doesn't produce an output. Any
459+ defining a function without * calling* it doesn't produce an output. Any
460460cells that use the now-changed functions will also have to be re-run for their
461461output to change.
462462
0 commit comments