Understanding and Implementing Hash Tables in Python