In article 
<e05e480b-8956-4984-b4cc-9a1666380...@l32g2000yqc.googlegroups.com>,
 n00m <n...@narod.ru> wrote:

> from bisect import insort_left
> 
> K = 5
> top = []
> while 1:
>     x = input()
>     if len(top) < K:
>         insort_left(top, x)
>     elif x > top[0]:
>         del top[0]
>         insort_left(top, x)
>     print top
> 
> 
> will be enough

Hmmm, that's an interesting idea.  Thanks.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to