On 02/09/2010 10:37 AM, Anand Chitipothu wrote:
On Tue, Feb 9, 2010 at 10:22 AM, Srinivas Reddy Thatiparthy
[...snip...]
#1.
You can even remove the square brackets.
sum(i for i in range(1000) if i%3==0 or i%5==0)
Yes, you can but that doesn't necessarily mean it is better. Interestingly,
something similar was discussed at comp.lang.python:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/7897bf3fd2298332/26247987f84cc484
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
_______________________________________________
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers