Here's a comment I just posted to some student work, reminiscing about a
thread we had earlier.
At some point I should go back and find the link.
Laura, hope you don't mind that I propagate your reputation in a positive
manner:
===
Yes, proficient and easy to read.
I would have been OK with no argument at all, no parameter, as the project
does say "current directory". However, you added one quite correctly,
using
os.path.join versus string concatenation, so extra points off the record.
You'll often see Pythonistas replacing this pattern:
for fn in files:
ext = os.path.splitext(fn)[1][1:]
if ext in extensions:
extensions[ext] += 1
else:
extensions[ext] = 1
with the idiom below, which on edu-sig, Laura Creighton, one of the best
devs,
criticized for being too obtuse, i.e. Python coders are somewhat the
opposite
of (early?) Perl coders, in not liking "cleverness". A fine line, as they
do
like "pithy".
for fn in files:
ext = os.path.splitext(fn)[1][1:]
extensions[ext] = extensions.get(ext, 0) + 1
-Kirby
[X] passes project