PDF de programación - Guía de aprendizaje de Python

Imágen de pdf Guía de aprendizaje de Python

Guía de aprendizaje de Pythongráfica de visualizaciones

Actualizado el 14 de Julio del 2017 (Publicado el 14 de Enero del 2017)
1.305 visualizaciones desde el 14 de Enero del 2017
215,7 KB
77 paginas
Creado hace 23a (24/11/2000)
Guía de aprendizaje de Python
Release 2.0

Guido van Rossum
Fred L. Drake, Jr., editor

16 de octubre de 2000

BeOpen PythonLabs
Correo electrónico: [email protected]

BEOPEN.COM TERMS AND CONDITIONS FOR PYTHON 2.0

BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1

1. This LICENSE AGREEMENT is between BeOpen.com (“BeOpen”), having an office at 160 Saratoga Avenue,
Santa Clara, CA 95051, and the Individual or Organization (“Licensee”) accessing and otherwise using this
software in source or binary form and its associated documentation (“the Software”).

2. Subject to the terms and conditions of this BeOpen Python License Agreement, BeOpen hereby grants Licensee
a non-exclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly,
prepare derivative works, distribute, and otherwise use the Software alone or in any derivative version, provided,
however, that the BeOpen Python License is retained in the Software, alone or in any derivative version prepared
by Licensee.

3. BeOpen is making the Software available to Licensee on an “AS IS” basis. BEOPEN MAKES NO REPRESEN-
TATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION,
BEOPEN MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTA-
BILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE
WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.

4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE SOFTWARE FOR
ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF USING,
MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY DERIVATIVE THEREOF, EVEN IF ADVI-
SED OF THE POSSIBILITY THEREOF.

5. This License Agreement will automatically terminate upon a material breach of its terms and conditions.

6. This License Agreement shall be governed by and interpreted in all respects by the law of the State of Cali-
fornia, excluding conflict of law provisions. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between BeOpen and Licensee. This License Agreement
does not grant permission to use BeOpen trademarks or trade names in a trademark sense to endorse or promote
products or services of Licensee, or any third party. As an exception, the “BeOpen Python” logos available at
http://www.pythonlabs.com/logos.html may be used according to the permissions granted on that web page.

7. By copying, installing or otherwise using the software, Licensee agrees to be bound by the terms and conditions

of this License Agreement.

CNRI OPEN SOURCE LICENSE AGREEMENT

Python 1.6 is made available subject to the terms and conditions in CNRI’s License Agreement. This Agreement
together with Python 1.6 may be located on the Internet using the following unique, persistent identifier (known as a
handle): 1895.22/1012. This Agreement may also be obtained from a proxy server on the Internet using the following
URL: http://hdl.handle.net/1895.22/1012.

CWI PERMISSIONS STATEMENT AND DISCLAIMER

Copyright c 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The Netherlands. All rights reserved.
Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is
hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and
this permission notice appear in supporting documentation, and that the name of Stichting Mathematisch Centrum or
CWI not be used in advertising or publicity pertaining to distribution of the software without specific, written prior
permission.

STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFT-
WARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CON-
SEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Resumen

Python es un lenguaje de programación fácil de aprender y potente. Tiene eficaces estructuras de datos de alto nivel
y una solución de programación orientada a objetos simple pero eficaz. La elegante sintaxis de Python, su gestión de
tipos dinámica y su naturaleza interpretada hacen de él el lenguaje ideal para guiones (scripts) y desarrollo rápido de
aplicaciones, en muchas áreas y en la mayoría de las plataformas.

El intérprete de Python y la extensa biblioteca estándar están disponible libremente, en forma de fuentes o ejecuta-
bles, para las plataformas más importantes en la sede web de Python, http://www.python.org, y se pueden distribuir
libremente.

La misma sede contiene también distribuciones y direcciones de muchos módulos, programas y herramientas Python
de terceras partes, además de documentación adicional.
Es fácil ampliar el intérprete Python con nuevas funciones y tipos de datos implementados en C y C++ (u otros lengua-
jes a los que se pueda acceder desde C). Python es también adecuado como lenguaje de extensión para aplicaciones
adaptables al usuario. Esta guía presenta informalmente al lector los conceptos y características básicos del lenguaje
y sistema Python. Es conveniente tener a mano un intérprete para hacer experimentos, pero todos los ejemplos son
autosuficientes, así que la guía se puede leer sin estar conectado.

Para obtener descripciones de módulos y objetos estándar, consulta el documento Referencia de las bibliotecas. El
Manual de Referencia de Python ofrece una definición más formal del lenguaje. Para escribir extensiones en C o C++,
lee los manuales de Extensión e incrustación y Referencia de la API Python/C. Existen también diversos libros que
tratan Python con detalle. Esta guía no intenta ser exhaustiva ni agotar cada capacidad de Python, ni siquiera las más
comúnmente utilizadas. En lugar de esto, introduce muchas de las capacidades que caracterizan Python y proporciona
una idea clara del estilo y sabor del lenguaje. Tras su lectura, el lector será capaz de leer y escribir módulos y programas
en Python y estará preparado para aprender más sobre los diversos módulos de biblioteca Python descritos en la
Referencia de las bibliotecas.

ÍNDICE GENERAL

1 Abriendo el apetito

1.1

Por dónde seguir .

.

.

.

.

.

.

.

.

.

.

. .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. . . .

. .

. .

. . .

2 Utilización del intérprete Python
Llamar al intérprete
.
El intérprete y su entorno .

2.1
2.2

.

.

.

.
.

.
.

.
.

.
.

.
.

3

Introducción informal a Python
3.1
3.2

Python como calculadora
.
Primeros pasos programando .

.

.

.

.
.
. . .

.
.

.
.

. .
.
.

.
.

.
.

.
.

.
.

.
.

.
.

.
.

.
.

.
.
. .

.
.

. .
.

.
. .

.
.

.
.

.
.

.
.

.
.

4 Más herramientas de control de flujo
.
.
.

4.1
4.2
4.3
4.4
.
.
4.5
4.6 Definición de funciones
. . .
4.7 Más sobre la definición de funciones

.
.
Construcciones if .
.
Sentencias for .
.
.
La función range() .
.
Construcciones con break, continue y else en bucles
.
Construcciones con pass .
.
.
.

.
.
.
.
. . .

.
.
.
.
. .

.
. .
.
.

. .
. .
.
.

. .
.
.

.
.
.

.
.
.

.
.
.

.
.
.

.
.
.

.
.
.

.
.
.

.
.
.

.
.
.

.
.
.

.
.
.

.
.
.

.
.
.

.
.
.

.
.
.

.
.

.
.
.

.
.

.

.
.

.

5 Estructuras de datos

La sentencia del .
Tuplas y secuencias
.

.
5.1 Más sobre las listas
.
5.2
.
5.3
5.4 Diccionarios
.
5.5 Más sobre las condiciones .
5.6

. .
.
. .
.
.
.
.
Comparación entre secuencias y otros tipos .

.
. . .
.
.
.
.
.
.
. .
.
.
.
.

.
. .
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.

.

.

6 Módulos

6.1 Más sobre los módulos
.
6.2 Módulos estándar
.
6.3
6.4
.

.
La función dir() .
Paquetes
.

.

.

.

.

.

.
.
.
.

.
.
.
.

.
.
.
.

. . .
.
.
.
.
.
.
.
. .
.

.
.
.

.
.
.

7 Entrada y salida

7.1
7.2

Formato de salida mejorado .
.
Lectura y escritura de ficheros .

. . .
.
.

.

8 Errores y excepciones

.
.
.
.

.
.

.
.
. .
. .
.
.

.
.

.
.

.
.
.
.

.
.

.
.
.
.
.
.

.
.
.
.

.
.

.
.
.
.
.
.

.
.
.
.
.
.
.
.
. .
.
.

. .
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.

.
.
.
.

.
.

.
.

. .
. .

.
.
.
.
.
.

.
.
.
.

.
.

.
.
.
.
.
.

.
.
.
.

.
.

.
.

.
.

.
.
.

.
.
.

.
.
.
.
.
.

.
.
.
.

.
.

.
.

.
.

.
.

.
.

.
.
.
.
.
.
.
.
.
.
.
.
. .

.
.
.
.
.
.

.
.
.
.

.
.

.
.
.
.
.
.

.
.
.
.

.
.

.
.

.
.

.
.
.
.
.
.
.

.
.

.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
. .

.
.
.
.

.
.

.
.
.
.

.
.

.
.

.
.

.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.

.
.

.
.

.
.

.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.

.
.

.
.

.
.

.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.

.
.

.
.

.
.

.
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.

.
.

.
.

.
.

.
.
.
.
.
.
.

.
.
.
.
.
.

.
.

.
.

.
.
.
.
.
.
.

.
.
.
.
.
.

.
.

.
.

.
.
.
.
.
.
.

.
.
.
.
.
.

.
.

.
.

.
.

.
.

.
.

.
.

. .
.
.

.
.

.
.

.
.

.
.

.

.

.
. .
. . . . .

.
.

. .
. .
. . . .

. .
.
.
. .
. .
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
. .
.
.
.
.
.
.
. .
.
.
.
.

.
.
.
. .
. .
. . .
. .
. .
.
.
.
.
. .
. . . . .
. .
. .

. .
.
.

.
.
.
.
.
.

. .

. .

.
.
. .
.
.
.
. .
.
.
.
.

. .
.
.
.
.

. .
.
.
.
.
.
.

. .

. .
. . .
. .
.
. .
.
.
. .
.
.
.
. .
. .
.
.
.
.
. .

.
.
.
.
.
.
. .

.
.
.
.
.
.
. .

.
.
.
.
.
.
. .

.
.
. .
. .
. .

. .
.
.
.
.
. .

. .
.
.
.
.
. .

. .
. .
. .
. .

.
.

.
.

.
.

.
.

.
.

.
.

.
.

.
.

.
.

.
.

.
.

. . .
.
. .

8.1

Errores de sintaxis .

.

.

.

.

.

.

.

.

.

.

. .

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

. .

. .

. .

. .

. .

1
2

3
3
4

7
7
16

19
19
19
20
21
21
22
23

29
29
33
34
35
35
36

37
38
40
40
41

45
45
47

51
51

i

.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
. .
.
.

.
.
.
.
.

. .
.
.
.
.
.
.
.
.
.
.
.
.

.
.
. .
.
.
.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.

.
.
  • Links de descarga
http://lwp-l.com/pdf556

Comentarios de: Guía de aprendizaje de Python (0)


No hay comentarios
 

Comentar...

Nombre
Correo (no se visualiza en la web)
Valoración
Comentarios...
CerrarCerrar
CerrarCerrar
Cerrar

Tienes que ser un usuario registrado para poder insertar imágenes, archivos y/o videos.

Puedes registrarte o validarte desde aquí.

Codigo
Negrita
Subrayado
Tachado
Cursiva
Insertar enlace
Imagen externa
Emoticon
Tabular
Centrar
Titulo
Linea
Disminuir
Aumentar
Vista preliminar
sonreir
dientes
lengua
guiño
enfadado
confundido
llorar
avergonzado
sorprendido
triste
sol
estrella
jarra
camara
taza de cafe
email
beso
bombilla
amor
mal
bien
Es necesario revisar y aceptar las políticas de privacidad