dictionnaries and lookup tables

2005-10-11 Thread m . barenco
Hello, I am considering using dictionnaries as lookup tables e.g. >>>D={0.5:3.9,1.5:4.2,6.5:3} and I would like to have a dictionnary method returning the key and item of the dictionnary whose key is smaller than the input of the method (or <=,>,>=) but maximal (resp. maximal,minimal,minimal) eg

Re: dictionnaries and lookup tables

2005-10-11 Thread m . barenco
>Sure they're implemented. Oops, my apologies. Just to build up on that, when I run: #start of listing import random A={1:None,2:None,"hello":None,(1,2,3):None} def dictcomp(n): for i in range(n): B=A.copy() C=A.copy() b=random.uniform(0,

Re: dictionnaries and lookup tables

2005-10-11 Thread m . barenco
Ok, Thanks for your answers, that's pretty unambiguous. M. -- http://mail.python.org/mailman/listinfo/python-list