Created
October 7, 2016 15:52
-
-
Save ejcer/9614afecdb0acf77a86097dc77d88bc3 to your computer and use it in GitHub Desktop.
Revisions
-
eddytbd created this gist
Oct 7, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #unpythonic code in idiom_tests_copy.py: result = [] for i in range(10): s = i ** 2 result.append(s) print(sum(result)) #pythonic code that I was attempting to transform idiom_tests_copy.py into: result = [i**2 for i in range(10)] print(sum(result))