Created
April 10, 2018 20:24
-
-
Save gaieges/490cb874bb91411c4eaa4acc19e8be08 to your computer and use it in GitHub Desktop.
map / foreach
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 characters
>>> x = ['a', 'b', 'c'] | |
>>> x | |
['a', 'b', 'c'] | |
>>> list(map(lambda z: z+'-peen' , x)) | |
['a-peen', 'b-peen', 'c-peen'] | |
>>> for z in x: | |
... print(z+'-peen') | |
... | |
a-peen | |
b-peen | |
c-peen | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment