Thanks to the watchful students who commented in the forum today, 2 interesting issues about Python's hash() have come to my attention: 1. hash() is platform dependent. This means hash(x) on the same x may differ between different platforms, specifically between 32/64 bit.
2. Even more, hash(x) does not guarantee the same result even in the same platform when starting a new instance of IDLE. That's because some randomization occurs when IDLE starts, for security reasons (read more). However throughout the lifetime of a specific IDLE instance, hash IS obviously consistent.
This has bad effects on the tests for count_words2 provided in skeleton5.py. So, please replace the assertion line of count_words2 in test() with these 3 lines:
h = count_words2(["ab", "cd", "cd", "ef", "cd", "ab"]) h_flat = [pair for lst in h for pair in lst] assert ['cd', 3] in h_flat and ['ab', 2] in h_flat and ['ef', 1] in h_flat
An updated version of skeleton5.py was uploaded.