Ir al contenido principal

E.1. Applicability and Definitions

This License applies to any manual or other work that contains a notice placed
by the copyright holder saying it can be distributed under the terms of this Li-
cense. The \Document," below, refers to any such manual or work. Any member
of the public is a licensee, and is addressed as \you."
A \Modi¯ed Version" of the Document means any work containing the Docu-
ment or a portion of it, either copied verbatim, or with modi¯cations and/or
translated into another language.
A \Secondary Section" is a named appendix or a front-matter section of the
Document that deals exclusively with the relationship of the publishers or aut-
hors of the Document to the Document's overall subject (or to related matters)
and contains nothing that could fall directly within that overall subject. (For
example, if the Document is in part a textbook of mathematics, a Secondary
Section may not explain any mathematics.) The relationship could be a matter
of historical connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical, or political position regarding them.
The \Invariant Sections" are certain Secondary Sections whose titles are de-
signated, as being those of Invariant Sections, in the notice that says that the
Document is released under this License.
The \Cover Texts" are certain short passages of text that are listed, as Front-
Cover Texts or Back-Cover Texts, in the notice that says that the Document is
released under this License.
A \Transparent" copy of the Document means a machine-readable copy, repre-
sented in a format whose speci¯cation is available to the general public, whose
contents can be viewed and edited directly and straightforwardly with generic
text editors or (for images composed of pixels) generic paint programs or (for
drawings) some widely available drawing editor, and that is suitable for input to
text formatters or for automatic translation to a variety of formats suitable for
input to text formatters. A copy made in an otherwise Transparent ¯le format
whose markup has been designed to thwart or discourage subsequent modi¯ca-
tion by readers is not Transparent. A copy that is not \Transparent" is called
\Opaque."

 

Examples of suitable formats for Transparent copies include plain ASCII wit-
hout markup, Texinfo input format, LATEX input format, SGML or XML using
a publicly available DTD, and standard-conforming simple HTML designed for
human modi¯cation. Opaque formats include PostScript, PDF, proprietary for-
mats that can be read and edited only by proprietary word processors, SGML
or XML for which the DTD and/or processing tools are not generally availa-
ble, and the machine-generated HTML produced by some word processors for
output purposes only.
The \Title Page" means, for a printed book, the title page itself, plus such
following pages as are needed to hold, legibly, the material this License requires
to appear in the title page. For works in formats which do not have any title
page as such, \Title Page" means the text near the most prominent appearance
of the work's title, preceding the beginning of the body of the text.

Comentarios

Entradas populares de este blog

3.11. Diagramas de pila

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 ...

6.4. Tablas de dos dimensiones

Una tabla de dos dimensiones es una tabla en la que Usted elige una fila y una columna y lee el valor de la intersección. Un buen ejemplo es una tabla de multiplicar. Supongamos que desea imprimir una tabla de multiplicar para los valores del 1 al 6. Una buena manera de comenzar es escribir un bucle sencillo que imprima los múltiplos de 2, todos en una l³nea. 1: i = 1 2: while i <= 6: 3: print 2*i, '\t' , 4: i = i + 1 5: print La primera línea inicializa una variable lllamada i , que actuara como contador, o variable de bucle. Conforme se ejecuta el bucle, el valor de i se incrementa de 1 a 6. Cuando i vale 7, el bucle termina. Cada vez que se atraviesa el bucle, imprimimos el valor 2*i seguido por tres espacios. De nuevo, la coma de la sentencia print suprime el salto de línea. Despues de completar el bucle, la segunda sentencia print crea una línea nueva. La salida de este programa es: 2 4 6 8 10 12 Hasta ahora, bie...

C.3. Cartas, mazos y juegos Python

1: import random 2: class Carta: 3: listaDePalos = [ "Tr¶eboles" , "Diamantes" , "Corazones" , 4: "Picas" ] 5: listaDeValores = [ "nada" , "As" , "2" , "3" , "4" , "5" , "6" , "7" , 6: "8" , "9" , "10" , "Sota" , "Reina" , "Rey" ] 7: 8: def __init__(self, palo=0, valor=0): 9: self.palo = palo 10: self.valor = valor 11: def __str__(self): 12: return (self.listaDeValores[self.valor] + " de " +\ 13: self.listaDePalos[self.palo]) 14: def __cmp__(self, otro): 15: # controlar el palo 16: if self.palo > otro.palo: return 1 17: if self.palo < otro.palo: return -1 18: # si son del mismo palo, controlar el valor 19...