Python Introducción a la Programación
Transcript of Python Introducción a la Programación
Python
Introducción a laProgramación
Rogelio Ferreira Escutia
Profesor / InvestigadorTecnológico Nacional de MéxicoCampus Morelia
Contenido Versión de Python Intérprete de Python Hola Mundo en Python Zen of Python Comentarios Impresión de datos Variables Tipos de datos Operadores
Versión de Python
4
Python - Versión Para ver la versión instalada (en consola):
5
Python - Actualización Si no está actualizado para Python3 se abre la siguiente
ventana para que inicie la instalación (en sistemas MacOS):
Intérprete de Python
7
Python - Intérprete Para “entrar” al intérprete de Python (en consola) hay que
teclear:python
8
Python - Intérprete
-
Para “salir” del intérprete de Python (en consola) hay que teclear:exit()
Hola Mundo en Python
10
Python – Hola Mundo (consola)
.
> nano hola.py
> python3 hola.py
Hola Crayola!!!
11
Python – Hola mundo (con VSCode)
.
Abrir el archivo con el Visual Studio Code (previamente instalado)
12
Python – Hola mundo (con VSCode)
.
Abrir el archivo con el Visual Studio Code (previamente instalado) y correrlo en la consola:
Zen of Python
14
Zen of Python
.
Es una lista de principios de diseño para el lenguaje Python:
15
Comentarios
17
Comentarios
.
Para poner comentarios en nuestro código:
Impresión de datos
19
Imprimir mensaje
.
Usando comillas:
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
Tipos de Datos
24
Enteros (int)
"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019
25
Cadenas (strings)
"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019
26
Boleanas (boolean)
"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019
Operadores
28
Operadores Aritméticos
"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019
29
Operadores de comparación
"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019
30
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
32
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
34
Ciclos de enteros
"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019
35
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
36
Ciclo de una cadena
"Python All in one for Dummies", John Sovic y Alan Simpson, Jhon Wiley and Sons Editorial, New Jersey USA 2019
37
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
39
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
41
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
43
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:
44
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
46
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
48
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:
49
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:
50
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
Profesor / InvestigadorTecnológico Nacional de MéxicoCampus Morelia
xumarhu.net
@rogeplus
https://www.youtube.com/channel/UC0on88n3LwTKxJb8T09sGjg
rogelioferreiraescutia