https://wiki.cabal.mx/index.php?title=Curso_de_Programaci%C3%B3n_en_Python/ForContinue&feed=atom&action=history
Curso de Programación en Python/ForContinue - Historial de revisiones
2024-03-29T11:11:41Z
Historial de revisiones para esta página en el wiki
MediaWiki 1.32.1
https://wiki.cabal.mx/index.php?title=Curso_de_Programaci%C3%B3n_en_Python/ForContinue&diff=5948&oldid=prev
Rrc: /* ForContinue.py */
2014-09-11T22:28:15Z
<p><span dir="auto"><span class="autocomment">ForContinue.py</span></span></p>
<p><b>Página nueva</b></p><div>__NOTOC__<br />
* [[:#ForContinue.py | ForContinue.py]]<br />
** [[:#Resultado | Resultado]]<br />
** [[:#Explicación | Explicación]]<br />
<br />
== ForContinue.py ==<br />
<br />
<syntaxhighlight lang="python" line="GESHI_FANCY_LINE_NUMBERS"><br />
<br />
#!/usr/bin/python3<br />
<br />
for Num in range( -4, 12 ):<br />
if ( Num == 0 ):<br />
print( "No es legal dividir por 0, Siguiente" )<br />
continue<br />
print( "100 /", Num, " =", ( 100 / Num ) )<br />
print( "Listo" )<br />
<br />
# Mira que el ultimo en el rango es excluido<br />
<br />
</syntaxhighlight><br />
<br />
=== Resultado ===<br />
<br />
[rrc@Llawyr PythonClase]$ ./ForContinue.py<br />
100 / -4 = -25.0<br />
100 / -3 = -33.333333333333336<br />
100 / -2 = -50.0<br />
100 / -1 = -100.0<br />
No es legal dividir por 0, Siguiente<br />
100 / 1 = 100.0<br />
100 / 2 = 50.0<br />
100 / 3 = 33.333333333333336<br />
100 / 4 = 25.0<br />
100 / 5 = 20.0<br />
100 / 6 = 16.666666666666668<br />
100 / 7 = 14.285714285714286<br />
100 / 8 = 12.5<br />
100 / 9 = 11.11111111111111<br />
100 / 10 = 10.0<br />
100 / 11 = 9.090909090909092<br />
Listo<br />
<br />
=== Explicación ===<br />
<br />
<br />
[[Category:Programación en Python]]<br />
[[Category:PythonCabal]]<br />
[[Category:CursoPython]]</div>
Rrc