swcarpentry / python-novice-gapminder

Plotting and Programming in Python
http://swcarpentry.github.io/python-novice-gapminder/
Other
163 stars 427 forks source link

Avoid setting encapsulation challenge too early #579

Closed alex-ball closed 2 years ago

alex-ball commented 2 years ago

In episode 16, the panel "Encapsulation of an If/Print Block" asks the learner to turn the if-block into a function a total of three times:

Only the last of these is needed. The first one is particularly unhelpful as it comes before the task is properly defined.

This pull request removes the duplication, and instead provides a potential rationale for wanting to do the task in the first place. (It also removes some trailing spaces.)