I have about 10million values that I need to put in some type of look up table, so I was wondering which would be more efficient a list or dict?
I know
A dict is a hash table, so it is really fast to find the keys. So between dict and list, dict would be faster. But if you don't have a value to associate, it is even better to use a set. It is a hash table, without the "table" part.
EDIT: for your new question, YES, a set would be better. Just create 2 sets, one for sequences ended in 1 and other for the sequences ended in 89. I have sucessfully solved this problem using sets.
set() is exactly what you want. O(1) lookups, and smaller than a dict.