The Free Software Foundation may publish new, revised versions of the GNU
Free Documentation License from time to time. Such new versions will be similar
in spirit to the present version, but may di®er in detail to address new problems
or concerns. See http:///www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number. If the Do-
cument speci¯es that a particular numbered version of this License .or any later
version.applies to it, you have the option of following the terms and conditions
either of that speci¯ed version or of any later version that has been published
(not as a draft) by the Free Software Foundation. If the Document does not spe-
cify a version number of this License, you may choose any version ever published
(not as a draft) by the Free Software Foundation.
Para mantener el rastro de que variables pueden usarse y donde, a veces es útil dibujar un diagrama de pila. Como los diagramas de estado, los diagramas de pila muestran el valor de cada variable, pero también muestran la función a la que cada variable pertenece. Cada función se representa por una caja con el nombre de la función junto a el. Los parámetros y variables que pertenecen a una función van dentro. Por ejemplo, el diagrama de stack para el programa anterior tiene este aspecto: El orden de la pila muestra el flujo de ejecución. imprimeDoble fue llamado por catDoble y a catDoble lo invoco __main__ , que es un nombre especial de la función mas alta. Cuando crea una variable fuera de cualquier función, pertenece a main En cada caso, el parámetro se refiere al mismo valor que el argumento correspondiente. Así que parte1 en catDoble tiene el mismo valor que cantus1 en main . Si sucede un error durante la llamada a una función, Python imprime el nombre de la función ...
Comentarios
Publicar un comentario