python-novice-inflammation
python-novice-inflammation copied to clipboard
Describe/Document 'sorted' function
In the 'Tidying Up' section of the Creating Functions episode, the sorted
built in function is introduced without providing any current (or prior) documentation about what it does. The line in question is:
filenames = sorted(glob.glob('inflammation*.csv'))
Possible solutions:
-
include a comment in the code itself
-
Add a description in the paragraph above
-
Remove the sorted command all together
Hi @charlie-becker, thanks for bringing up your concern. The sorted
function first appears in the 05-files.md
episode where it is briefly introduced to alphabetically sort the list of files produced by glob.glob()
. When it comes up in the "Tidying Up" section it is in the context of "[reproducing] the previous analysis".