Guido van Rossum strung bits together to say: > except compactness of exprssion. How frequent is > > result = 0.0 > for x in S: > result += x**2 > > ??? > > (I've already said my -1 about your 'sum of ...' proposal.) Just so this suggestion doesn't get buried in the part of the thread where I was getting rather carried away about Greg's 'of' syntax (sorry!). What about: result + x**2 from result = 0.0 for x in S Essentially short for: result = 0.0 for x in S: result = result + x**2 Cheers, Nick. -- Nick Coghlan | Brisbane, Australia ICQ#: 68854767 | ncoghlan at email.com Mobile: 0409 573 268 | http://www.talkinboutstuff.net "Let go your prejudices, lest they limit your thoughts and actions."
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