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
| while a < 10: | |
| print a | |
| a = a + 1 |
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
| while condicion: | |
| instruccion_a_ejecutar | |
| else | |
| instruccion_fuera_del_bucle |
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
| for Variable in Lista: | |
| instrucciones |
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
| Huerto = ["zanahoria", "col", "lechuga", "col"] | |
| for Planta in Huerto: | |
| if Planta != "col" | |
| print Planta | |
| else | |
| print "Odio las coles" |
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
| for Variable in Lista: | |
| instrucciones | |
| else | |
| ya_no_quedan_elementos |
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= 0 | |
| while x < 10: | |
| if x == 5 | |
| break | |
| print x | |
| x = x + 1 |
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= 0 | |
| while x < 9: | |
| x = x + 1 | |
| if x == 5: | |
| continue | |
| print x |
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
| resultado = dividendo/divisor | |
| print "La división resulta: ", resultado |
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
| try: | |
| resultado = dividendo/divisor | |
| print "La división resulta: ", resultado | |
| except: | |
| if divisor == 0: | |
| print "No puedes dividir por cero, animal" |
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
| except Tipo_de_Error: |