Check out the Pastebin Gadgets Shop. We have thousands of fun, geeky & affordable gadgets on sale :-)Want more features on Pastebin? Sign Up, it's FREE!

python list min

By: a guest on Jan 6th, 2013  |  syntax: Python  |  size: 0.24 KB  |  views: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print  |  QR code  |  clone
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def f5(lst, _lstm=sys.maxint): # martineau min-tracker version
  2.     d={}
  3.     for item in lst:
  4.         v=item[1]
  5.         if v:
  6.             d.setdefault(v,{})[item]=0
  7.             if v < _lstm:
  8.                 _lstm=v
  9.     return d[_lstm].keys()
clone this paste RAW Paste Data