[Python] capitating a list of integers

Martin Kelly aomighty at gmail.com
Sat May 12 00:10:17 PDT 2007


> is there a more elegant way to phrase that?

Yes. Use min().

[min(i, 100) for i in n]


More information about the Python mailing list