4 ms·
A Python dictionary is a hashtable structure. It's kind of perverse to iterate over the keys to find the value when you can just do the hash lookup directly. A
by LogicHoleFlaw 19y ago
A Python dictionary is a hashtable structure. It's kind of perverse to iterate over the keys to find the value when you can just do the hash lookup directly.
A PHP array() is also a hashtable structure. The PHP equivalent of the described code would be to do a foreach() over the array rather than doing an array[key] lookup.