https://wiki.cabal.mx/index.php?title=Curso_de_Programaci%C3%B3n_en_Python/ForBreak&feed=atom&action=history
Curso de Programación en Python/ForBreak - Historial de revisiones
2024-03-28T19:00:43Z
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/ForBreak&diff=5947&oldid=prev
Rrc: /* ForBreak.py */
2014-09-11T22:27:56Z
<p><span dir="auto"><span class="autocomment">ForBreak.py</span></span></p>
<p><b>Página nueva</b></p><div>__NOTOC__<br />
* [[:#ForBreak.py | ForBreak.py]]<br />
** [[:#Resultado | Resultado]]<br />
** [[:#Explicación | Explicación]]<br />
<br />
== ForBreak.py ==<br />
<br />
<syntaxhighlight lang="python" line="GESHI_FANCY_LINE_NUMBERS"><br />
<br />
#!/usr/bin/python3<br />
<br />
for Num in range( -4, 12 ): # Primer Ejemplo<br />
if ( Num == 0 ):<br />
print( "No es legal dividir por 0, Terminamos" )<br />
break<br />
print( "100 /", Num, " =", ( 100 / Num ) )<br />
<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]$ ./ForBreak.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, Terminamos<br />
Listo<br />
<br />
=== Explicación ===<br />
<br />
<br />
[[Category:Programación en Python]]<br />
[[Category:PythonCabal]]<br />
[[Category:CursoPython]]</div>
Rrc