“Micro Curso para programar en...

Post on 28-Jun-2020

14 views 0 download

Transcript of “Micro Curso para programar en...

“Micro Curso para programar en Python”

Rogelio Ferreira Escutia

Verificar versión de Python

3

Python - Versión

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

Para ver la versión instalada (en consola):

Entrar al intérprete de Python

5

Python - Intérprete

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

Para “entrar” al intérprete de Python (en consola) hay que teclear:

python

6

Python - Intérprete

-

Para “salir” del intérprete de Python (en consola) hay que teclear:

exit()

Hola Mundo en Python

8

Python – Hola Mundo (consola)

.

> nano hola.py

> python hola.py

Hola Crayola!!!

9

Python – Hola mundo (con VSCode)

.

Abrir el archivo con el Visual Studio Code (previamente instalado)

10

Python – Hola mundo (con VSCode)

.

Abrir el archivo con el Visual Studio Code (previamente instalado) y correrlo en la consola:

Zen of Python

12

Zen of Python

.

Es una lista de principios de diseño para el lenguaje Python:

13

Comentarios

15

Comentarios

.

Para poner comentarios en nuestro código:

Tipos de Datos

17

Enteros (int)

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

18

Cadenas (strings)

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

19

Boleanas (boolean)

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

Variables

21

Asignación de valores a variables

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

22

Manejo de variables

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

Operadores

24

Operadores Aritméticos

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

25

Operadores de comparación

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

26

Operadores Boleanos

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

Toma de Decisiones

28

Toma de decisiones (if)

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

Ciclos

30

Ciclos de enteros

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

31

Ciclos de un rango de enteros

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

32

Ciclo de una cadena

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

33

Ciclo de una lista

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

Ciclos condicionales

35

Ciclos condicionales (while)

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

Funciones integradas

37

Funciones integradas

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

Python cuenta con algunas funciones ya integradas al lenguaje:

Funciones matemáticas

39

Funciones matemáticas (1)

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

La librería “math” cuenta con algunas funciones:

40

Funciones matemáticas (2)

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

La librería “math” cuenta con algunas funciones:

Binario, Octal y Hexadecimal

42

Binario, Octal y Hexadecimal

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

Python cuenta con funciones para manejar estos números:

Manejo de Cadenas

44

Manejo de cadenas (1)

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

Python cuenta con funciones para manejo de cadenas:

45

Manejo de cadenas (2)

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

Python cuenta con funciones para manejo de cadenas:

46

Manejo de cadenas (3)

"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019

Python cuenta con funciones para manejo de cadenas:

Rogelio Ferreira Escutia

Instituto Tecnológico de MoreliaDepartamento de Sistemas y Computación

Correo: rogelio@itmorelia.edu.mx rogeplus@gmail.com

Página Web: http://sagitario.itmorelia.edu.mx/~rogelio/http://www.xumarhu.net/

Twitter: http://twitter.com/rogeplusFacebook: http://www.facebook.com/groups/xumarhu.net/