Anyway to clarify this code? (dictionaries)

bonono at gmail.com bonono at gmail.com
Tue Nov 22 22:50:12 EST 2005


Mike Meyer wrote:
> def my_search(another, keys, x):
>      new = dict()
>      for k in keys:
>          if another[k] >= x:
>             new[k] = another[k]
>      return new
> 
BTW, this would raise exception if k is not in another.




More information about the Python-list mailing list