Case insensitive dictionary?

Elbert Lev elbertlev at hotmail.com
Fri Jun 25 13:21:21 EDT 2004


Hi!

Here is the problem:

I have a dictionary. Keys are strings. How to make dictionary  lookup
case insensitive?

In other words:
If dict = {'First":"Bob", "Last":"Tom"}, dict["first"] should return
"Bob"

Maybe dictionary is not the right data type? If so what is?



More information about the Python-list mailing list