> I had a similar thought about 5 minutes after turning my computer off last > night. The alternative I came up with was: > > y = (from result = 0.0 do result += x**2 for x in values if x > 0) I think you're aiming for the wrong thing here; I really see no reason why you'd want to avoid writing this out as a real for loop if you don't have an existing accumulator function (like sum()) to use. --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4