File tree Expand file tree Collapse file tree 2 files changed +24
-5
lines changed
Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change 88.Rproj.user
99.Rhistory
1010.RData
11-
11+ .jekyll-cache
12+ .ruby-version
Original file line number Diff line number Diff line change @@ -206,9 +206,10 @@ print(total)
206206>
207207> > ## Solution
208208> >
209- > > It is a syntax error. The problem has to do with the placement of the code, not its logic.
210- >
211- > {: .solution}{: .challenge}
209+ > > It is a syntax error. The problem has to do with the placement of the code, not its logic.
210+ > >
211+ > {: .solution}
212+ {: .challenge}
212213
213214
214215> ## Tracing Execution
@@ -324,6 +325,23 @@ print(total)
324325> data = [1,2,2,5]
325326> ~~~
326327> {: .python}
328+ > >
329+ > > ## Solution
330+ > > ~~~
331+ > > data = [1,2,2,5]
332+ > > cumulative = []
333+ > > sum = 0
334+ > > for number in data:
335+ > > sum += number
336+ > > cumulative += [sum]
337+ > > print(cumulative)
338+ > > ~~~
339+ > > {: .python}
340+ > > ~~~
341+ > > [1, 3, 5, 10]
342+ > > ~~~
343+ > > {: .output}
344+ > {: .solution}
327345{: .challenge}
328346
329347> ## Identifying Variable Name Errors
@@ -332,7 +350,7 @@ print(total)
332350> *without* running it.
333351> 2. Run the code and read the error message.
334352> What type of `NameError` do you think this is?
335- > Is it a string with no quotes, a misspelled variable, or a
353+ > Is it a string with no quotes, a misspelled variable, or a
336354> variable that should have been defined but was not?
337355> 3. Fix the error.
338356> 4. Repeat steps 2 and 3, until you have fixed all the errors.
You can’t perform that action at this time.
0 commit comments