A hash table is a great data structure if you need to look things up efficiently (amortized constant time) and conveniently by key. And a Python dict uses a hash table, so it does exactly what you want out of the box.
A hash table is a great data structure if you need to look things up efficiently (amortized constant time) and conveniently by key. And a Python dict uses a hash table, so it does exactly what you want out of the box.