-
-
Save Macorreag/7e2fd46c1539edba59f8cfee7f1e8a45 to your computer and use it in GitHub Desktop.
Anidación de for en python para recorrer listas
This file contains 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
ar = [[x,y,z] for x in xlist for y in ylist for z in zlist if x + y + z != n] | |
print(ar) | |
#Es la misma sentencia que la de abajo | |
for x in xlist: | |
for y in ylist: | |
for z in zlist: | |
if (x+y+z != n): | |
print([x,y,z]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment