mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-26 20:34:32 +03:00
Merge pull request #4552 from SrMarques/patch-1
[python/es] Update incorrect variables
This commit is contained in:
commit
ffa3f12925
@ -421,7 +421,7 @@ map(sumar_10, [1,2,3]) #=> [11, 12, 13]
|
|||||||
filter(lambda x: x > 5, [3, 4, 5, 6, 7]) #=> [6, 7]
|
filter(lambda x: x > 5, [3, 4, 5, 6, 7]) #=> [6, 7]
|
||||||
|
|
||||||
# Podemos usar listas por comprensión para mapeos y filtros agradables
|
# Podemos usar listas por comprensión para mapeos y filtros agradables
|
||||||
[add_10(i) for i in [1, 2, 3]] #=> [11, 12, 13]
|
[sumar_10(i) for i in [1, 2, 3]] #=> [11, 12, 13]
|
||||||
[x for x in [3, 4, 5, 6, 7] if x > 5] #=> [6, 7]
|
[x for x in [3, 4, 5, 6, 7] if x > 5] #=> [6, 7]
|
||||||
# también hay diccionarios
|
# también hay diccionarios
|
||||||
{k:k**2 for k in range(3)} #=> {0: 0, 1: 1, 2: 4}
|
{k:k**2 for k in range(3)} #=> {0: 0, 1: 1, 2: 4}
|
||||||
|
Loading…
Reference in New Issue
Block a user