Showing preview only (7,756K chars total). Download the full file or copy to clipboard to get everything.
Repository: codingupmyfuture/bootcamplinuxpython
Branch: main
Commit: 822b39bb0ed0
Files: 280
Total size: 7.3 MB
Directory structure:
gitextract_qcm5fu1p/
├── .github/
│ └── workflows/
│ ├── notify.yml
│ └── send_telegram_message.py
├── .gitignore
├── LICENSE
├── README.md
├── contenido.curso/
│ ├── 002.videos/
│ │ ├── 001.welcome27072023.txt
│ │ └── 002.preguntas.respuestas.taller.txt
│ └── 003.recursos/
│ ├── LVL-1/
│ │ ├── LVL1.01.intro.ipynb
│ │ ├── LVL1.02.variables.print.ipynb
│ │ ├── LVL1.03.str.1.ipynb
│ │ ├── LVL1.04.str.2.ipynb
│ │ ├── LVL1.05.listas.tuplas.2.ipynb
│ │ ├── LVL1.05.numeros.bool.1.ipynb
│ │ ├── LVL1.06.diccionarios.1.ipynb
│ │ ├── LVL1.07.diccionarios.2.ipynb
│ │ ├── LVL1.08.funciones.globales.ipynb
│ │ └── LVL1.08.sets.ipynb
│ ├── LVL-2/
│ │ ├── LVL2.01.operadores.metacon.ipynb
│ │ ├── LVL2.02.condicionales.ipynb
│ │ ├── LVL2.03.bucles.ipynb
│ │ ├── LVL2.04.bucles2.funciones.ipynb
│ │ ├── LVL2.05.funciones2.ipynb
│ │ ├── LVL2.06.funciones3.ipynb
│ │ ├── LVL2.07.format.ipynb
│ │ ├── LVL2.08.files1.ipynb
│ │ ├── LVL2.09.files2.ipynb
│ │ └── LVL2.10.fechas.ipynb
│ ├── LVL-3/
│ │ ├── LV3_05_06_poo_3_4/
│ │ │ ├── 001_validador_elementales.py
│ │ │ ├── 002_validar_documentacion.py
│ │ │ ├── 003_validar_estaticos.py
│ │ │ ├── 004_metodos_de_clase.py
│ │ │ ├── 005_get_set.py
│ │ │ ├── README.md
│ │ │ ├── decoradores_clases/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── decoradores.py
│ │ │ │ ├── estaticos.py
│ │ │ │ └── metodos_de_clase.py
│ │ │ ├── docs/
│ │ │ │ └── clase.docs.txt
│ │ │ ├── documentacion/
│ │ │ │ ├── __init__.py
│ │ │ │ └── docs.py
│ │ │ ├── documentacion.docs.html
│ │ │ └── operaciones_matematicas/
│ │ │ ├── __init__.py
│ │ │ ├── elementales.py
│ │ │ └── elementales_objetos.py
│ │ ├── LVL3.01.clases.ipynb
│ │ ├── LVL3.02.clases.metadata.ipynb
│ │ ├── LVL3.03.cuatro.pilares.poo.1.ipynb
│ │ ├── LVL3.04.cuatro.pilares.poo.2.ipynb
│ │ ├── LVL3_07_08_clases_especiales/
│ │ │ ├── 001.test_atributos.py
│ │ │ ├── 002.ms_rep.py
│ │ │ ├── 003.ms_str.py
│ │ │ ├── 004.ms_str_rep.py
│ │ │ ├── 005.at_doc.py
│ │ │ ├── 006.ms_call.py
│ │ │ ├── 007.ms_format.py
│ │ │ ├── README.md
│ │ │ ├── especiales/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── ae_doc.py
│ │ │ │ ├── me_call.py
│ │ │ │ ├── me_format.py
│ │ │ │ ├── me_repr.py
│ │ │ │ ├── me_repr_str.py
│ │ │ │ └── me_str.py
│ │ │ └── generico/
│ │ │ ├── __init__.py
│ │ │ ├── calculadora.py
│ │ │ ├── poo.py
│ │ │ └── procedural.py
│ │ ├── LVL3_09_excepciones/
│ │ │ ├── 000.excepciones.ipynb
│ │ │ ├── 001.elemental.py
│ │ │ ├── 002.conmassazon.py
│ │ │ ├── 003.excepcioncarinosa.py
│ │ │ ├── 004.otro_tipo_de_captura.py
│ │ │ ├── 005.assert.py
│ │ │ ├── README.md
│ │ │ └── excepciones/
│ │ │ ├── __init__.py
│ │ │ └── elemental.py
│ │ └── LVL3_10_programacion_funcional/
│ │ ├── README.md
│ │ ├── asserts/
│ │ │ ├── __init__.py
│ │ │ ├── complejo.py
│ │ │ ├── con_mensaje.py
│ │ │ ├── ok.py
│ │ │ └── sin_mensaje.py
│ │ └── programacion_funcional/
│ │ ├── filter.py
│ │ ├── map.py
│ │ └── reduce.py
│ ├── LVL-4/
│ │ ├── LVL4.01.estructuracion.proyecto/
│ │ │ ├── 001.video.sesion.txt
│ │ │ └── README.md
│ │ ├── LVL4.02.dependencias.ambientes.virtuales/
│ │ │ ├── 001.RUTAS.ENVARIABLES.md
│ │ │ ├── 002.LIBRERIAS.md
│ │ │ ├── 003.AMBIENTES.VIRTUALES.md
│ │ │ ├── README.md
│ │ │ ├── directorios.archivos.info/
│ │ │ │ └── os.sys.ipynb
│ │ │ ├── paquetes.info/
│ │ │ │ ├── demo.py
│ │ │ │ ├── libreriapropia.py
│ │ │ │ ├── sistema.py
│ │ │ │ └── truco.sh
│ │ │ └── sistema.info/
│ │ │ ├── envariables.libexterna.py
│ │ │ ├── envariables.manuales.py
│ │ │ └── sistema.py
│ │ ├── LVL4.03.creacion.proyecto/
│ │ │ ├── README.md
│ │ │ ├── bootcamp/
│ │ │ │ ├── README.md
│ │ │ │ ├── demo/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── config/
│ │ │ │ │ │ ├── files/
│ │ │ │ │ │ │ └── .gitkeep
│ │ │ │ │ │ ├── images/
│ │ │ │ │ │ │ └── .gitkeep
│ │ │ │ │ │ └── messages/
│ │ │ │ │ │ └── mensajes.json
│ │ │ │ │ └── utilities/
│ │ │ │ │ └── demo.py
│ │ │ │ ├── pyproject.toml
│ │ │ │ └── tests/
│ │ │ │ └── __init__.py
│ │ │ ├── paquetes.info/
│ │ │ │ ├── demo.py
│ │ │ │ └── truco.sh
│ │ │ ├── proyecto_igual/
│ │ │ │ ├── README.md
│ │ │ │ ├── proyecto_igual/
│ │ │ │ │ └── __init__.py
│ │ │ │ ├── pyproject.toml
│ │ │ │ └── tests/
│ │ │ │ └── __init__.py
│ │ │ ├── proyecto_manual/
│ │ │ │ ├── README.md
│ │ │ │ ├── librerias/
│ │ │ │ │ └── utilitarios/
│ │ │ │ │ └── __init__.py
│ │ │ │ └── requirements.txt
│ │ │ └── proyecto_noigual/
│ │ │ ├── README.md
│ │ │ ├── apibootcamp/
│ │ │ │ └── __init__.py
│ │ │ ├── pyproject.toml
│ │ │ └── tests/
│ │ │ └── __init__.py
│ │ ├── LVL4.04.buenas.practicas.1/
│ │ │ ├── 001.YAML.md
│ │ │ ├── 002.LOGGIN.md
│ │ │ ├── 003.TYPING.md
│ │ │ ├── 004.ENTRYPOINT.md
│ │ │ ├── 005.SYSARGS.md
│ │ │ ├── 006.ARGPARSE.md
│ │ │ ├── README.md
│ │ │ ├── config/
│ │ │ │ ├── mensajes.yaml
│ │ │ │ └── simple.yaml
│ │ │ ├── snipcode/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── argparse/
│ │ │ │ │ ├── 01_uso_parser_elemental.py
│ │ │ │ │ └── 02_uso_argarser_opciones.py
│ │ │ │ ├── loggin/
│ │ │ │ │ ├── simple.py
│ │ │ │ │ └── uso_loggin_avanzado.py
│ │ │ │ ├── main/
│ │ │ │ │ ├── para_proyecto.py
│ │ │ │ │ └── uso_main.py
│ │ │ │ ├── sysargs/
│ │ │ │ │ └── uso_sysargs.py
│ │ │ │ ├── typing/
│ │ │ │ │ └── uso_typing.py
│ │ │ │ └── yaml/
│ │ │ │ └── uso_yaml.py
│ │ │ ├── test_loggin.py
│ │ │ └── test_yaml.py
│ │ ├── LVL4.05.git.basico/
│ │ │ ├── 001.video.sesion.txt
│ │ │ ├── Dockerfile
│ │ │ └── README.md
│ │ ├── LVL4.06.07.buenas.practicas.2/
│ │ │ ├── FLAKE8.md
│ │ │ ├── PYTEST.md
│ │ │ ├── README.md
│ │ │ └── calidad/
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── borrar.py
│ │ │ ├── calidad/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── config/
│ │ │ │ │ └── files/
│ │ │ │ │ └── demo.yaml
│ │ │ │ ├── pruebas/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── linting.py
│ │ │ │ │ └── operaciones.py
│ │ │ │ └── utilitarios/
│ │ │ │ └── texto.py
│ │ │ ├── pyproject.toml
│ │ │ ├── setup.cfg
│ │ │ └── tests/
│ │ │ ├── __init__.py
│ │ │ ├── conftest.py
│ │ │ ├── pruebas/
│ │ │ │ ├── test_linting.py
│ │ │ │ └── test_operaciones.py
│ │ │ └── utilitarios/
│ │ │ └── test_texto.py
│ │ ├── LVL4.08.dataclases.pydantic/
│ │ │ ├── README.md
│ │ │ ├── dataclases.pydantic.ipynb
│ │ │ └── video.clase.txt
│ │ └── LVL4.09.expresiones.regulares/
│ │ └── LVL4.09.expresiones.regulares.ipynb
│ └── LVL-5/
│ ├── LVL5.01.intro.linux/
│ │ ├── linux.000.intro.ipynb
│ │ └── video.txt
│ ├── LVL5.02.intro.consola/
│ │ └── comandos.txt
│ ├── LVL5.03.intro.os/
│ │ ├── comandos.txt
│ │ ├── demo.py
│ │ ├── demo_error.py
│ │ ├── info_comandos.txt
│ │ ├── labp.txt
│ │ └── sesion_5.json
│ ├── LVL5.04.intro.os.dos/
│ │ └── seson_4.cast
│ ├── LVL5.05.vim.operadores/
│ │ ├── 001.vim.comandos.txt
│ │ ├── datasets/
│ │ │ ├── col.deptos.txt
│ │ │ ├── columnas.txt
│ │ │ ├── ips.txt
│ │ │ ├── logs.txt
│ │ │ └── nf.txt
│ │ └── s5.cast
│ ├── LVL5.06.programacion.1/
│ │ ├── archivos_eliminar.txt
│ │ ├── datasets/
│ │ │ ├── col.deptos.txt
│ │ │ ├── columnas.txt
│ │ │ ├── ips.txt
│ │ │ ├── logs.txt
│ │ │ └── nf.txt
│ │ ├── docs/
│ │ │ ├── formato.fecha.avanzado.txt
│ │ │ └── formato.fecha.elemental.txt
│ │ ├── s6.cast
│ │ └── variables.sh
│ ├── LVL5.07.programacion.2/
│ │ ├── 000.comentarios.sh
│ │ ├── 001.if.sh
│ │ ├── 002.for.sh
│ │ ├── 003.while.sh
│ │ ├── 004.parametros.shell.sh
│ │ ├── docs/
│ │ │ └── linux.006.basico.programacion.ipynb
│ │ ├── log.2
│ │ ├── log.txt
│ │ ├── programa.py
│ │ └── video/
│ │ └── link.txt
│ ├── LVL5.08.programacion.3/
│ │ ├── case.sh
│ │ ├── central.sh
│ │ ├── funciones.sh
│ │ ├── s8.cast
│ │ └── utilitarios/
│ │ └── genericos.sh
│ ├── LVL5.09.programacion.4/
│ │ ├── aplinux.sh
│ │ ├── apython.py
│ │ ├── case_final.sh
│ │ ├── conf.yaml
│ │ ├── consideraciones.txt
│ │ ├── entrada_consola.sh
│ │ ├── entrada_consola_avanzada.sh
│ │ └── s9.cast
│ ├── LVL5.10.practica.final/
│ │ ├── analisis/
│ │ │ └── requerimientos_tareas.txt
│ │ ├── app.sh
│ │ ├── componentes/
│ │ │ ├── get_header.py
│ │ │ └── utilities.sh
│ │ ├── ingredientes/
│ │ │ ├── escribir_ini.py
│ │ │ ├── leer_ini.py
│ │ │ └── parse_args.py
│ │ └── video/
│ │ └── video.txt
│ └── tutorial.asciinema/
│ ├── comandos.txt
│ └── video.txt
├── material.apoyo/
│ ├── complementos/
│ │ ├── pandas.ipynb
│ │ └── random.ipynb
│ ├── issues/
│ │ ├── 001.tutorial.github.issues.txt
│ │ └── pandas.ipynb
│ └── trabajo.final/
│ └── V1/
│ ├── Makefile
│ ├── README.md
│ ├── __init__.py
│ ├── __meta__.py
│ ├── apolo-11.py
│ ├── documentacion/
│ │ └── criterios.desarrollados/
│ │ └── 001.index.documentacion.xlsx
│ ├── nasa/
│ │ ├── __init__.py
│ │ ├── comunes/
│ │ │ ├── constantes.py
│ │ │ ├── decoradores.py
│ │ │ ├── excepcion.py
│ │ │ ├── inicializador.py
│ │ │ ├── parametros.py
│ │ │ └── utilitarios.py
│ │ ├── config/
│ │ │ ├── archivos/
│ │ │ │ ├── app.yaml
│ │ │ │ └── mensajes.yaml
│ │ │ ├── deltas/
│ │ │ │ └── generador
│ │ │ └── logotipos/
│ │ │ ├── nasa
│ │ │ └── softserve
│ │ ├── modelamiento/
│ │ │ ├── abstraccion/
│ │ │ │ ├── operaciones_os.py
│ │ │ │ └── reportes.py
│ │ │ ├── enumeradores/
│ │ │ │ └── reportes.py
│ │ │ ├── herencia/
│ │ │ │ └── acciones_os.py
│ │ │ ├── modelo/
│ │ │ │ └── archivos.py
│ │ │ └── propiedades/
│ │ │ └── instancias.py
│ │ └── negocio/
│ │ ├── generardor.py
│ │ └── reportes.py
│ ├── pyproject.toml
│ ├── setup.cfg
│ └── tests/
│ ├── __init__.py
│ ├── comunes/
│ │ ├── constantes.py
│ │ ├── decoradores.py
│ │ ├── excepciones.py
│ │ ├── inicializador.py
│ │ ├── parametros.py
│ │ ├── utilitarios_funcionalidades.py
│ │ └── utilitarios_struct.py
│ ├── conftest.py
│ ├── modelamiento/
│ │ ├── enumeradores.py
│ │ └── modelo.py
│ ├── nasa/
│ │ └── config/
│ │ ├── archivos/
│ │ │ ├── app.yaml
│ │ │ └── mensajes.yaml
│ │ ├── deltas/
│ │ │ └── generador
│ │ └── logotipos/
│ │ ├── nasa
│ │ └── softserve
│ └── negocio/
│ └── generador_reporte.py
└── trabajos/
├── trabajo.final.linux/
│ └── .gitkeep
└── trabajo.final.python/
└── criterios.evaluacion/
└── .gitkeep
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/notify.yml
================================================
name: Notificar nuevo issue en Telegram
on:
issues:
types: [opened]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
node-version: '16'
- name: Install dependencies
run: |
pip install requests
- name: Notify Telegram
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_GROUP_ID: ${{ secrets.TELEGRAM_GROUP_ID }}
run: |
python .github/workflows/send_telegram_message.py \
'${{ secrets.TELEGRAM_BOT_TOKEN }}' \
'${{ secrets.TELEGRAM_GROUP_ID }}' \
'${{ github.event.issue.user.login }}' \
'${{ github.event.issue.title }}' \
'${{ github.event.issue.html_url }}' \
'${{ github.event.issue.number }}' \
"${{ join(github.event.issue.labels.*.name, ', ') }}"
================================================
FILE: .github/workflows/send_telegram_message.py
================================================
import sys
import requests
from datetime import datetime, timedelta
bot_token = sys.argv[1]
group_id = sys.argv[2]
user = sys.argv[3]
issue_title = sys.argv[4]
issue_url = sys.argv[5]
issue_number = sys.argv[6]
issue_tags = sys.argv[7]
message = f'''
<b>[Nuevo Ticket] - ID #: {issue_number}</b>
<b>Creado por:</b> {user}
<b>Tema:</b> {issue_title}
<b>Enlace:</b> <a href="{issue_url}">click aquí</a>
<b>Tags:</b> {issue_tags}
<b>Notificación:</b> {(datetime.now() - timedelta(hours=5)).strftime("%d/%m/%Y : %H:%M:%S")}
'''
print(message)
r =requests.post(
f'https://api.telegram.org/bot{bot_token}/sendMessage',
json={'chat_id': group_id, 'text': message, 'parse_mode' : 'HTML'}
)
================================================
FILE: .gitignore
================================================
# VSCODE
docker-compose.yml
python
# Pytest coverage may generate XML files
*.xml
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Librariries
src/libs/
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
.DS_Store
/*/*/.DS_Store
/*/.DS_Store
.idea
#
~/
.VSCODE
.vscode
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2023 codingupmyfuture
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/13/SoftServe_logo_2017.svg/179px-SoftServe_logo_2017.svg.png?20220507181101" alt="reporte" border="0"/>
<p><br>
<img width="400" src="https://github-readme-stats.vercel.app/api?username=codingupmyfuture&count_private=true&show_icons=true&theme=react" /> <img width="425" src="https://streak-stats.demolab.com/?user=codingupmyfuture&theme=react" />
<img width="830" src="https://github-readme-activity-graph.vercel.app/graph?username=codingupmyfuture&bg_color=21232a&color=a8eeff&line=61dafb&point=f0fcff&area=true&hide_border=false" />
<a href="https://github.com/codingupmyfuture/github-stats">
</a>
**Coding Up My Future** es un bootcamp diseñado con el objetivo de generar un impacto social al ayudar a personas, sin importar sus condiciones sociales, a ingresar al mundo de las tecnologías de la información. El curso se enfoca en proporcionar una base sólida de conocimientos teóricos y prácticos, distribuidos en **80 horas para Python y 20 para Linux, para un total de 100 horas de estudio**. Los objetivos de este Bootcam son:
- Brindar a los participantes habilidades fundamentales en programación y tecnología de la información.
- Impulsar el acceso a oportunidades laborales en el campo de la tecnología, fomentando la inclusión y la igualdad de oportunidades.
- Fomentar el desarrollo de proyectos prácticos para aplicar los conocimientos adquiridos.
## Tabla de contenido
- [Requisitos](#requisitos)
- [Estructura del bootcamp](#estructura-del-bootcamp)
- [Estructura repositorio](#informacion-repositorio)
- [Colaboradores o instructores](#colaboradores-o-instructores)
- [Licencia](#licencia)
- [Recomendaciones](#recomendaciones)
## Requisitos
Para participar en el Bootcamp, es indispensable los siguientes requisitos:
* Haber sido seleccionado y cumplido todos los requisitos
* Saber leer
* Manejo básico de un computador
* Contar con tiempo para realizar los trabajos del Bootcamp
## Estructura del bootcamp
El bootcamp se divide en varios módulos o secciones principales. A continuación se detallan:
<img src="https://i.postimg.cc/TwQ0Fj6s/estimation-bootcamp.png" alt="reporte" border="0"/>
## Estructura repositorio
El material del bootcamp estará disponible en las siguientes carpetas:
```linux
.
├── LICENSE # Licencia del repositorio.
├── README.md # Leame
├── documentos # Carpeta para cargar archivos.
│ └── algún-archivo
├── material.apoyo # Carpeta para cargar material código visto en clase
│ └── LVL-1
│ └── algún-archivo
└── trabajos # Carpeta para cargar trabajos (LVL-4).
└── algún-archivo
```
## Colaboradores o instructores
El bootcamp es creado y presentado por el instructor **Luis Fernando Vásquez Vergara**. El cual cuenta con más de 15 años de experiencia trabajando en la industria del software, especialmente en el area de ingeniería datos.

<a target="_blank" href="https://www.linkedin.com/in/luisvasv/"><img src="https://img.shields.io/badge/-LinkedIn-0077B5?style=for-the-badge&logo=Linkedin&logoColor=white"></img></a>
## Licencia
El contenido de este bootcamp se proporciona bajo la Licencia **MIT**. Consulta el archivo de licencia almcenado en esta repositorio para mas información.
## Recomendaciones
Para no tener ningún problema con el curso y la asistencia, por favor asegúrese que la versión sea superior a **5.2.16**

================================================
FILE: contenido.curso/002.videos/001.welcome27072023.txt
================================================
link video:
https://drive.google.com/file/d/1Q1VWFpm5UI04JXHWT49zV02LQtpmjK_u/view?usp=sharing
================================================
FILE: contenido.curso/002.videos/002.preguntas.respuestas.taller.txt
================================================
video realizado el 16/08/2023 para resolver dudas y respuestas
https://drive.google.com/file/d/1lmo04EqV2-_8prOJfWuu_QwtHZZ0Uo9U/view?usp=sharing
================================================
FILE: contenido.curso/003.recursos/LVL-1/LVL1.01.intro.ipynb
================================================
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"toc_visible": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"source": [
"<p><img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"\" width=\"1280\" height=\"300\" /></p>"
],
"metadata": {
"id": "7Vj8ZBaLuxRf"
}
},
{
"cell_type": "markdown",
"source": [
"# **CONCEPTOS TEÓRICOS**"
],
"metadata": {
"id": "FosqPaLLvzID"
}
},
{
"cell_type": "markdown",
"source": [
"## **¿QUÉ ES UN NOTEBOOK?**\n",
"\n",
"Los Jupyter Notebooks son una herramienta interactiva de código abierto muy popular en el ámbito de la ciencia de datos, la investigación y la educación. Proporcionan un entorno computacional interactivo que permite combinar texto, código ejecutable, gráficos y elementos multimedia, todo en un único documento.\n",
"\n",
"Para entenderlo veámoslo desde un punto de vista común:\n",
"<p><img src=\"https://media.licdn.com/dms/image/D4D12AQH4sRoj9narOg/article-cover_image-shrink_423_752/0/1684856996049?e=1696464000&v=beta&t=l2rZpBStN1O1l1wQ4fwhRurAQ5mUf4_sjHEydT64gmM\" alt=\"\" width=\"468\" height=\"200\" /></p>\n"
],
"metadata": {
"id": "xreUqKtx8qRO"
}
},
{
"cell_type": "markdown",
"source": [
"## **¿QUÉ ES MARKDOWN?**\n",
"\n",
"**Markdown** es un lenguaje de marcado ligero y fácil de usar que se utiliza para formatear texto de manera sencilla y rápida. Se diseñó para ser legible en su forma no formateada, lo que lo convierte en una excelente opción para escribir documentos, READMEs, blogs y páginas web.\n",
"\n",
"\n",
"\n",
"* [**TUTORIAL DETALLADO**](https://markdown.es/sintaxis-markdown/)\n",
"\n",
"* [**HERRAMIENTA RECOMENDADA**](https://hackmd.io/)\n",
"\n",
"\n",
"\n",
"---\n",
"**EJEMPLOS:**"
],
"metadata": {
"id": "VyV6mvgkwIF8"
}
},
{
"cell_type": "markdown",
"source": [
"### **ENLACES EXTERNOS (LINKS)**\n",
"\n",
"[Clic Aquí](https://www.python.org/static/community_logos/python-logo.png)"
],
"metadata": {
"id": "3NpO0s26wIDI"
}
},
{
"cell_type": "markdown",
"source": [
"### **TABLAS**\n",
"\n",
"| Nombre | Edad | Profesión | Profesión |\n",
"|:----------:|------:|:--------------|-------------|\n",
"| Ana | 30 | Desarrollador | Programadora |\n",
"| Carlos | 25 | Diseñador | Diseñador |\n",
"| Laura | 28 | Escritor | Escritor |\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"```\n",
":--: |centrado\n",
":--: | centrado derecha\n",
":-- | centrado izquierda\n",
"-- | centrado izquierda\n",
"```\n",
"\n"
],
"metadata": {
"id": "vU74bktLwIAa"
}
},
{
"cell_type": "markdown",
"source": [
"### **VIÑETAS**\n",
"\n",
"\n",
"\n",
"* AAAA\n",
" - AAAA-1\n",
"* BBBB\n",
" - BBBB-2\n"
],
"metadata": {
"id": "s7071KsvwH92"
}
},
{
"cell_type": "markdown",
"source": [
"### **NÚMEROS**\n",
"\n",
"\n",
"\n",
"1. 111\n",
" - 111-A\n",
" * 111-A\n",
"2. 222\n",
" - 222-A"
],
"metadata": {
"id": "4e2op1qcz-JR"
}
},
{
"cell_type": "markdown",
"source": [
"### **SEPARACIÓN POR LÍNEA**\n",
"\n",
"---"
],
"metadata": {
"id": "ElyEMxce0vVd"
}
},
{
"cell_type": "markdown",
"source": [
"### **CÓDIGO UNILÍNEA**\n",
"\n",
"Estoy ejecutando el comando `hola` y genera un error.\n",
"\n",
"\n"
],
"metadata": {
"id": "V9kO4e4x0CPn"
}
},
{
"cell_type": "markdown",
"source": [
"### **CÓDIGO MULTILÍNEA**\n",
"\n",
"Estoy ejecutando el comando `hola` y genera el siguiente error:\n",
"\n",
"\n",
"\n",
"```\n",
"cómo van?\n",
"cómo están?\n",
"..\n",
"..\n",
"..\n",
"bye!\n",
"```\n",
"\n",
"Nota:\n",
"\n",
"Cuando se tiene código multilínea, se le puede especificar el lenguaje para\n",
"resaltar su sintaxis después de las 3 comillas invertidas.\n",
"\n",
"\n",
"\n",
"\n",
"* `java` para Java\n",
"* `python` para Python\n",
"* `javascript` para JavaScript\n",
"* `html` para HTML\n",
"* `css` para CSS\n",
"* `bash` para comandos de la terminal (Bash)\n",
"* `sql` para SQL (Structured Query Language)\n",
"* `ruby` para Ruby\n",
"* `cpp` o `c++` para C++\n",
"* `php` para PHP\n",
"* `markdown` para el propio Markdown (útil para mostrar ejemplos de Markdown)\n"
],
"metadata": {
"id": "xu8UcN4X0HXw"
}
},
{
"cell_type": "markdown",
"source": [
"### **HTML**\n",
"\n",
"\n",
"\n",
"\n",
"**Encabezados HTML:**\n",
"\n",
"html\n",
"Copy code\n",
"<!-- HTML -->\n",
"<h1>Título 1</h1>\n",
"<h2>Título 2</h2>\n",
"<h3>Título 3</h3>\n",
"\n",
"\n",
"**Equivalente en Markdown:**\n",
"\n",
"\n",
"```\n",
"# Título 1\n",
"## Título 2\n",
"### Título 3\n",
"```\n",
"\n",
"<p><img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"\" width=\"260\" height=\"63\" /></p>\n"
],
"metadata": {
"id": "1_XNQeGi0MND"
}
},
{
"cell_type": "markdown",
"source": [
"### **LATEX**\n",
"\n",
"Pará más información, visite: [link](https://manualdelatex.com/tutoriales)\n",
"\n",
"\n",
"\\begin{align}\n",
"\\mathbf{a} \\cdot \\mathbf{b} = \\sum_{i=1}^n a_i b_i.\n",
"\\end{align}\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"LaTeX | symbol\n",
"--- | :---:\n",
"`\\approx` | $\\approx$\n",
"`\\sim` | $\\sim$\n",
"`\\propto` | $\\propto$\n",
"`\\le` | $\\le$\n",
"`ge` | $\\ge$\n",
"`\\pm` | $\\pm$\n",
"`\\in` | $\\in$\n",
"`\\ln` | $\\ln$\n",
"`\\exp` | $\\exp$\n",
"`\\prod_{i\\in D}` | ${\\displaystyle \\prod_{i\\in D}}$\n",
"`\\sum_{i\\in D}` | ${\\displaystyle \\sum_{i\\in D}}$\n",
"`\\frac{\\partial f}{\\partial x}` | ${\\displaystyle \\frac{\\partial f}{\\partial x}}$\n",
"`\\sqrt{x}` | $\\sqrt{x}$\n",
"`\\bar{x}` | $\\bar{x}$\n",
"`\\langle x \\rangle` | $\\langle x \\rangle$\n",
"`\\left\\langle \\frac{x}{y} \\right\\rangle` | $\\left\\langle \\frac{x}{y} \\right\\rangle$"
],
"metadata": {
"id": "_DlmTxllglj2"
}
},
{
"cell_type": "markdown",
"source": [
"## **¿CÓMO APRENDER A PROGRAMAR?**\n",
"\n",
"\n",
"<p><img src=\"https://i.postimg.cc/FzpXQ3bt/caap.jpg\" alt=\"\" width=\"1024\" height=\"723\" /></p>\n"
],
"metadata": {
"id": "cvKY7UIt-P_u"
}
},
{
"cell_type": "markdown",
"source": [
"## **CONCEPTOS ELEMENTALES**"
],
"metadata": {
"id": "oAES1xAjqp-u"
}
},
{
"cell_type": "markdown",
"source": [
"### **¿QUÉ ES PYTHON?**\n",
"\n",
"\n",
"<p><img src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/Guido_van_Rossum_OSCON_2006.jpg/1200px-Guido_van_Rossum_OSCON_2006.jpg\" alt=\"\" width=\"225\" height=\"320\" /></p>\n",
"\n",
"\n",
"Python es un lenguaje de programación de alto nivel, interpretado, de propósito general y con una sintaxis clara y legible. Fue creado por Guido van Rossum, un programador holandés, y la primera versión de Python se lanzó en 1991. Desde entonces, ha ganado una gran popularidad debido a su facilidad de uso, su enfoque en la legibilidad del código y su amplia comunidad de desarrolladores que han creado una gran cantidad de bibliotecas y módulos que facilitan el desarrollo de aplicaciones en diversos campos.\n",
"\n",
"[cuál versión usar](https://devguide.python.org/versions/)?\n"
],
"metadata": {
"id": "xWCkCH_mvpWH"
}
},
{
"cell_type": "markdown",
"source": [
"### **¿QUÉ ES UNA VARIABLE?**\n",
"\n",
"Una variable es un contenedor que se utiliza para almacenar y representar datos en memoria. Puedes pensar en una variable como una caja etiquetada en la que puedes poner un valor específico, y luego referirte a ese valor usando el nombre de la variable.\n",
"\n",
"\n",
"<p><img src=\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCnQzYw8GAj_eq6r2OR10JTYpw4RTQ93oSdpG1NB9KDrbsAyxT3HuDBlQUwBdfhg_w_k0jpuXLr4b9vECrNGv9ZegTlmEt668iQn3vuJc0VIy6DTzTWnByErxaAh3silXD67I6tqS3ekt4xkvUs3v6Urly0R9n4j5M6MLX6-9GxiJJfZdyiydrQ5AYQg/s800/image%20(15).webp\" alt=\"\" width=\"544\" height=\"233\" /></p>\n",
"\n",
"\n",
"Mirémoslo desde una mirada más simple:\n",
"<p><img src=\"https://img.yumpu.com/43636336/1/500x640/formulario-de-cambio-de-partidos-fecha-lugar-hora-federacian-.jpg\" alt=\"\" width=\"452\" height=\"640\" /></p>\n",
"\n",
"\n",
"\n",
"\n"
],
"metadata": {
"id": "Qfd8cIJFqysB"
}
},
{
"cell_type": "markdown",
"source": [
"### **¿QUÉ ES UN LENGUAJE DE PROGRAMACIÓN?**\n",
"\n",
"<p><img src=\"https://piperlab.es/wp-content/uploads/2020/09/lenguajes-de-programacion.jpg\" alt=\"\" width=\"544\" height=\"233\" /></p>\n",
"\n",
"\n",
"Un lenguaje de programación es como un conjunto de instrucciones que le das a una computadora para que realice tareas específicas. Puedes pensar en ello como si estuvieras dando una serie de pasos detallados y precisos a una persona para que realice una tarea.\n",
"\n",
"\n",
"Un lenguaje de programación consta de elementos como palabras clave, operadores, símbolos especiales, reglas de sintaxis y semántica, entre otros. Los programas escritos en un lenguaje de programación deben cumplir con las reglas y estructuras definidas en ese lenguaje para que sean comprensibles y ejecutables por la máquina.\n",
"\n",
"\n",
"\n"
],
"metadata": {
"id": "xEZYHmK5qymi"
}
},
{
"cell_type": "markdown",
"source": [
"## **CONOCIMIENTO DEL LENGUAJE DE PROGRAMACIÓN**\n",
"\n",
"\n",
"Las cinco preguntas que siempre se recomienda preguntar:"
],
"metadata": {
"id": "q-ifh44M-P84"
}
},
{
"cell_type": "markdown",
"source": [],
"metadata": {
"id": "4iRcfEIb-P44"
}
},
{
"cell_type": "markdown",
"source": [
"### **1.LENGUAJE COMPILADO O INTERPRETADO**\n",
"\n",
"\n",
"<p><img src=\"https://i.postimg.cc/FHg0cxb5/cmvsnocm.png\" alt=\"\" width=\"544\" height=\"233\" /></p>\n",
"\n"
],
"metadata": {
"id": "54HtHGcvclDa"
}
},
{
"cell_type": "markdown",
"source": [
"### **2.¿CUÁLES PARADIGMAS DE PROGRAMACIÓN MANEJA?**\n",
"\n",
"<p><img src=\"https://keepcoding.io/wp-content/uploads/2022/08/paradigmas-de-programacion.jpg\" alt=\"\" width=\"544\" height=\"233\" /></p>\n",
"\n",
"\n",
"\n",
"Para entenderlo veámoslo desde un punto de vista común:\n",
"<p><img src=\"https://i.postimg.cc/FzSV6dqj/pinturas.png\" alt=\"\" width=\"468\" height=\"146\" /></p>\n",
"\n",
"\n",
"\n",
"1. Acuarela.\n",
"2. Óleo.\n",
"3. Gouache.\n",
"4. Aerografía.\n",
"5. Pintura al pastel.\n",
"6. Temple o témpera.\n",
"7. Fresco.\n",
"8. Acrílico.\n",
"\n"
],
"metadata": {
"id": "acjdKdDeck9U"
}
},
{
"cell_type": "markdown",
"source": [
"#### **PROGRAMACIÓM IMPERATIVA**\n",
"\n",
"Python es un lenguaje imperativo en su núcleo, lo que significa que se ejecuta línea por línea, indicando cómo lograr el resultado paso a paso. Los programas en Python están compuestos principalmente por declaraciones y comandos que modifican el estado del programa.\n",
"\n",
"\n",
"\n",
"```python\n",
"def factorial_iterative(n):\n",
" result = 1\n",
" for i in range(1, n+1):\n",
" result *= i\n",
" return result\n",
"\n",
"print(factorial_iterative(5)) # Salida: 120\n",
"```\n",
"\n"
],
"metadata": {
"id": "d7cxBfBZhnzQ"
}
},
{
"cell_type": "markdown",
"source": [
"#### **PROGRAMACIÓN ORIENTADA A OBJETOS (OOP)**\n",
"\n",
" Python es un lenguaje orientado a objetos, lo que permite la definición de clases y objetos. Los objetos encapsulan datos y comportamientos, y las clases son plantillas que definen cómo se crean esos objetos. Python facilita la creación de objetos y el uso de herencia, polimorfismo y encapsulación.\n",
"\n",
"\n",
"\n",
"```python\n",
"class Persona:\n",
" def __init__(self, nombre, edad):\n",
" self.nombre = nombre\n",
" self.edad = edad\n",
"\n",
" def saludar(self):\n",
" return f\"Hola, mi nombre es {self.nombre} y tengo {self.edad} años.\"\n",
"\n",
"persona1 = Persona(\"Juan\", 30)\n",
"print(persona1.saludar()) # Salida: \"Hola, mi nombre es Juan y tengo 30 años.\"e\n",
"```\n",
"\n"
],
"metadata": {
"id": "LtqEPRioBRFw"
}
},
{
"cell_type": "markdown",
"source": [
"#### **PROGRAMACIÓN FUNCIONAL**\n",
"\n",
"Python admite programación funcional, que se centra en el uso de funciones como elementos de primer orden. Esto significa que las funciones pueden tratarse como cualquier otro objeto, lo que permite el uso de funciones anónimas (lambda), funciones de orden superior y operaciones de mapeo y reducción.\n",
"\n",
"\n",
"\n",
"```python\n",
"numeros = [1, 2, 3, 4, 5]\n",
"\n",
"# Usando funciones de orden superior\n",
"cuadrados = list(map(lambda x: x ** 2, numeros))\n",
"print(cuadrados) # Salida: [1, 4, 9, 16, 25]\n",
"\n",
"# Usando comprensiones de listas\n",
"cubos = [x ** 3 for x in numeros]\n",
"print(cubos) # Salida: [1, 8, 27, 64, 125]\n",
"```\n",
"\n"
],
"metadata": {
"id": "jMXBVjZrhntk"
}
},
{
"cell_type": "markdown",
"source": [
"#### **PROGRAMACIÓN PROCEDURAL**\n",
"\n",
"Python es adecuado para la programación procedural, que es un estilo de programación estructurado que divide el programa en procedimientos y subrutinas para resolver problemas.\n",
"\n",
"\n",
"\n",
"\n",
"```python\n",
"def suma(a, b):\n",
" return a + b\n",
"\n",
"resultado = suma(3, 5)\n",
"print(resultado) # Salida: 8\n",
"```\n",
"\n",
"\n"
],
"metadata": {
"id": "cYE5VzcFhnni"
}
},
{
"cell_type": "markdown",
"source": [
"### **3. LENGUAJE DE TIPADO DINÁMICO O ESTÁTICO**\n",
"\n",
"<p><img src=\"https://res.cloudinary.com/practicaldev/image/fetch/s--i1yqfSl1--/c_imagga_scale,f_auto,fl_progressive,h_900,q_auto,w_1600/https://miro.medium.com/max/1400/1%2ABddwVWW6hFU0miT9DCbUWQ.png\" alt=\"\" width=\"544\" height=\"233\" /></p>\n",
"\n"
],
"metadata": {
"id": "-2Vpz_aWhna0"
}
},
{
"cell_type": "markdown",
"source": [
"#### **ESTÁTICO O FUERTE**\n",
"\n",
"En un lenguaje tipado, también llamados de tipado estricto, se caracterizan porque requieren que definamos el tipo de dato específico de las variables y expresiones que vamos a utilizar.\n",
"\n",
"\n",
"```java\n",
"int numero = 5;\n",
"int resultado = numero + 10;\n",
"resultado = \"hola\"; // error\n",
"```\n",
"\n"
],
"metadata": {
"id": "VUhrOhxThnUI"
}
},
{
"cell_type": "markdown",
"source": [
"\n",
"#### **NO TIPADO O DINÁMICO**\n",
"En un lenguaje no tipado, también llamados de tipado dinámico, no necesitan que indiquemos el tipo de las variables y expresiones al declarar la variable.\n",
"\n",
"\n",
"\n",
"```python\n",
"numero = 5\n",
"resultado = numero + 10\n",
"resultado = \"hola\" # OK\n",
"```\n",
"\n"
],
"metadata": {
"id": "nzDsEqhDpYBK"
}
},
{
"cell_type": "markdown",
"source": [
"### **4. INDENTACIÓN DEL CÓDIGO**\n",
"\n",
"<p><img src=\"https://python.pages.doc.ic.ac.uk/java/lessons/java/01-intro/_images/guessing_game_braces.png\" alt=\"\" width=\"1365\" height=\"653\" /></p>\n",
"\n",
"\n",
"\n",
"---\n",
"\n"
],
"metadata": {
"id": "YMp9n6YMgIkn"
}
},
{
"cell_type": "markdown",
"source": [
"### **5. TIPOS DE DATOS QUE SOPORTA**\n",
"\n",
"En Python, existen varios tipos de datos que se utilizan para representar diferentes tipos de valores. Algunos de los tipos de datos más comunes en Python son los siguientes:\n",
"\n",
"### **Números**\n",
"\n",
"- **Enteros (int):** Representan números enteros positivos o negativos, por ejemplo, `1`, `100`, `-42`.\n",
"\n",
"- **Números de Punto Flotante (float):** Representan números con parte decimal, por ejemplo, `3.14`, `2.718`.\n",
"\n",
"\n",
"\n",
"- **Cadenas de caracteres (str):** Son secuencias de caracteres encerradas entre comillas, por ejemplo, `\"Hola, mundo\"`.\n",
"\n",
"\n",
"\n",
"- **Valores booleanos (bool):** Representan la verdad o la falsedad de una expresión. Pueden ser `True` o `False`.\n",
"\n",
"\n",
"- **Listas (list):** Son secuencias ordenadas de elementos que pueden ser de diferentes tipos, por ejemplo, `[1, 2, 3]`, `['a', 'b', 'c']`.\n",
"\n",
"\n",
"- **Tuplas (tuple):** Son secuencias ordenadas de elementos inmutables, por ejemplo, `(1, 2, 3)`.\n",
"\n",
"\n",
"- **Conjuntos (set):** Son colecciones no ordenadas de elementos únicos, por ejemplo, `{1, 2, 3}`.\n",
"\n",
"\n",
"- **Diccionarios (dict):** Son colecciones de pares clave-valor, por ejemplo, `{'nombre': 'Juan', 'edad': 30}`.\n",
"\n",
"\n",
"\n",
"- **None:** Es un tipo especial que representa la ausencia de valor, similar a `null` en otros lenguajes.\n",
"\n"
],
"metadata": {
"id": "BHGZYH_aBRDu"
}
},
{
"cell_type": "markdown",
"source": [
"## **MANOS A LA OBRA!!**"
],
"metadata": {
"id": "5F6jxwLFwKv2"
}
}
]
}
================================================
FILE: contenido.curso/003.recursos/LVL-1/LVL1.02.variables.print.ipynb
================================================
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"toc_visible": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"source": [
"<p><img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"\" width=\"1280\" height=\"300\" /></p>"
],
"metadata": {
"id": "7Vj8ZBaLuxRf"
}
},
{
"cell_type": "markdown",
"source": [
"# **CONCEPTOS TEÓRICOS**"
],
"metadata": {
"id": "FosqPaLLvzID"
}
},
{
"cell_type": "markdown",
"source": [
"## **¿QUÉ ES UN NOTEBOOK?**\n",
"\n",
"Los Jupyter Notebooks son una herramienta interactiva de código abierto muy popular en el ámbito de la ciencia de datos, la investigación y la educación. Proporcionan un entorno computacional interactivo que permite combinar texto, código ejecutable, gráficos y elementos multimedia, todo en un único documento.\n",
"\n",
"Para entenderlo veámoslo desde un punto de vista común:\n",
"<p><img src=\"https://media.licdn.com/dms/image/D4D12AQH4sRoj9narOg/article-cover_image-shrink_423_752/0/1684856996049?e=1696464000&v=beta&t=l2rZpBStN1O1l1wQ4fwhRurAQ5mUf4_sjHEydT64gmM\" alt=\"\" width=\"468\" height=\"200\" /></p>\n"
],
"metadata": {
"id": "xreUqKtx8qRO"
}
},
{
"cell_type": "markdown",
"source": [
"### **SOPORTA EJECUCIÓN AL O.S (SISTEMA OPERATIVO)**\n",
"\n",
"para interactuar col el os, el comando linux debe ir precedido por un `!`"
],
"metadata": {
"id": "mVC3tnDl9Wnp"
}
},
{
"cell_type": "code",
"source": [
"!cat /etc/*release*"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "PDYIQ00V9WL-",
"outputId": "1ad51c58-f0cd-4a81-8484-a072cf6d9515"
},
"execution_count": 39,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"DISTRIB_ID=Ubuntu\n",
"DISTRIB_RELEASE=22.04\n",
"DISTRIB_CODENAME=jammy\n",
"DISTRIB_DESCRIPTION=\"Ubuntu 22.04.2 LTS\"\n",
"PRETTY_NAME=\"Ubuntu 22.04.2 LTS\"\n",
"NAME=\"Ubuntu\"\n",
"VERSION_ID=\"22.04\"\n",
"VERSION=\"22.04.2 LTS (Jammy Jellyfish)\"\n",
"VERSION_CODENAME=jammy\n",
"ID=ubuntu\n",
"ID_LIKE=debian\n",
"HOME_URL=\"https://www.ubuntu.com/\"\n",
"SUPPORT_URL=\"https://help.ubuntu.com/\"\n",
"BUG_REPORT_URL=\"https://bugs.launchpad.net/ubuntu/\"\n",
"PRIVACY_POLICY_URL=\"https://www.ubuntu.com/legal/terms-and-policies/privacy-policy\"\n",
"UBUNTU_CODENAME=jammy\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!date"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "PleW1rWQ9s5J",
"outputId": "8bd4f1a1-aa4c-4275-972e-4e0da87c4ba5"
},
"execution_count": 41,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Fri Aug 4 12:33:43 AM UTC 2023\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## **¿QUÉ ES MARKDOWN?**\n",
"\n",
"**Markdown** es un lenguaje de marcado ligero y fácil de usar que se utiliza para formatear texto de manera sencilla y rápida. Se diseñó para ser legible en su forma no formateada, lo que lo convierte en una excelente opción para escribir documentos, READMEs, blogs y páginas web.\n",
"\n",
"\n",
"\n",
"* [**TUTORIAL DETALLADO**](https://markdown.es/sintaxis-markdown/)\n",
"\n",
"* [**HERRAMIENTA RECOMENDADA**](https://hackmd.io/)\n",
"\n",
"\n",
"\n",
"---\n",
"**EJEMPLOS:**"
],
"metadata": {
"id": "VyV6mvgkwIF8"
}
},
{
"cell_type": "markdown",
"source": [
"### **ENLACES EXTERNOS (LINKS)**\n",
"\n",
"[Clic Aquí](https://www.python.org/static/community_logos/python-logo.png)"
],
"metadata": {
"id": "3NpO0s26wIDI"
}
},
{
"cell_type": "markdown",
"source": [
"### **TABLAS**\n",
"\n",
"| Nombre | Edad | Profesión | Profesión |\n",
"|:----------:|------:|:--------------|-------------|\n",
"| Ana | 30 | Desarrollador | Programadora |\n",
"| Carlos | 25 | Diseñador | Diseñador |\n",
"| Laura | 28 | Escritor | Escritor |\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"```\n",
":--: |centrado\n",
":--: | centrado derecha\n",
":-- | centrado izquierda\n",
"-- | centrado izquierda\n",
"```\n",
"\n"
],
"metadata": {
"id": "vU74bktLwIAa"
}
},
{
"cell_type": "markdown",
"source": [
"### **VIÑETAS**\n",
"\n",
"\n",
"\n",
"* AAAA\n",
" - AAAA-1\n",
"* BBBB\n",
" - BBBB-2\n"
],
"metadata": {
"id": "s7071KsvwH92"
}
},
{
"cell_type": "markdown",
"source": [
"### **NÚMEROS**\n",
"\n",
"\n",
"\n",
"1. 111\n",
" - 111-A\n",
" * 111-A\n",
"2. 222\n",
" - 222-A"
],
"metadata": {
"id": "4e2op1qcz-JR"
}
},
{
"cell_type": "markdown",
"source": [
"### **SEPARACIÓN POR LÍNEA**\n",
"\n",
"---"
],
"metadata": {
"id": "ElyEMxce0vVd"
}
},
{
"cell_type": "markdown",
"source": [
"### **CÓDIGO UNILÍNEA**\n",
"\n",
"Estoy ejecutando el comando `hola` y genera un error.\n",
"\n",
"\n"
],
"metadata": {
"id": "V9kO4e4x0CPn"
}
},
{
"cell_type": "markdown",
"source": [
"### **CÓDIGO MULTILÍNEA**\n",
"\n",
"Estoy ejecutando el comando `hola` y genera el siguiente error:\n",
"\n",
"\n",
"\n",
"```\n",
"cómo van?\n",
"cómo están?\n",
"..\n",
"..\n",
"..\n",
"bye!\n",
"```\n",
"\n",
"Nota:\n",
"\n",
"Cuando se tiene código multilínea, se le puede especificar el lenguaje para\n",
"resaltar su sintaxis después de las 3 comillas invertidas.\n",
"\n",
"\n",
"\n",
"\n",
"* `java` para Java\n",
"* `python` para Python\n",
"* `javascript` para JavaScript\n",
"* `html` para HTML\n",
"* `css` para CSS\n",
"* `bash` para comandos de la terminal (Bash)\n",
"* `sql` para SQL (Structured Query Language)\n",
"* `ruby` para Ruby\n",
"* `cpp` o `c++` para C++\n",
"* `php` para PHP\n",
"* `markdown` para el propio Markdown (útil para mostrar ejemplos de Markdown)\n"
],
"metadata": {
"id": "xu8UcN4X0HXw"
}
},
{
"cell_type": "markdown",
"source": [
"### **HTML**\n",
"\n",
"\n",
"\n",
"\n",
"**Encabezados HTML:**\n",
"\n",
"html\n",
"Copy code\n",
"<!-- HTML -->\n",
"<h1>Título 1</h1>\n",
"<h2>Título 2</h2>\n",
"<h3>Título 3</h3>\n",
"\n",
"\n",
"**Equivalente en Markdown:**\n",
"\n",
"\n",
"```\n",
"# Título 1\n",
"## Título 2\n",
"### Título 3\n",
"```\n",
"\n",
"<p><img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"\" width=\"260\" height=\"63\" /></p>\n"
],
"metadata": {
"id": "1_XNQeGi0MND"
}
},
{
"cell_type": "markdown",
"source": [
"### **LATEX**\n",
"\n",
"Pará más información, visite: [link](https://manualdelatex.com/tutoriales)\n",
"\n",
"\n",
"\\begin{align}\n",
"\\mathbf{a} \\cdot \\mathbf{b} = \\sum_{i=1}^n a_i b_i.\n",
"\\end{align}\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"LaTeX | symbol\n",
"--- | :---:\n",
"`\\approx` | $\\approx$\n",
"`\\sim` | $\\sim$\n",
"`\\propto` | $\\propto$\n",
"`\\le` | $\\le$\n",
"`ge` | $\\ge$\n",
"`\\pm` | $\\pm$\n",
"`\\in` | $\\in$\n",
"`\\ln` | $\\ln$\n",
"`\\exp` | $\\exp$\n",
"`\\prod_{i\\in D}` | ${\\displaystyle \\prod_{i\\in D}}$\n",
"`\\sum_{i\\in D}` | ${\\displaystyle \\sum_{i\\in D}}$\n",
"`\\frac{\\partial f}{\\partial x}` | ${\\displaystyle \\frac{\\partial f}{\\partial x}}$\n",
"`\\sqrt{x}` | $\\sqrt{x}$\n",
"`\\bar{x}` | $\\bar{x}$\n",
"`\\langle x \\rangle` | $\\langle x \\rangle$\n",
"`\\left\\langle \\frac{x}{y} \\right\\rangle` | $\\left\\langle \\frac{x}{y} \\right\\rangle$"
],
"metadata": {
"id": "_DlmTxllglj2"
}
},
{
"cell_type": "markdown",
"source": [
"## **¿CÓMO APRENDER A PROGRAMAR?**\n",
"\n",
"\n",
"<p><img src=\"https://i.postimg.cc/FzpXQ3bt/caap.jpg\" alt=\"\" width=\"1024\" height=\"723\" /></p>\n"
],
"metadata": {
"id": "cvKY7UIt-P_u"
}
},
{
"cell_type": "markdown",
"source": [
"## **CONCEPTOS ELEMENTALES**"
],
"metadata": {
"id": "oAES1xAjqp-u"
}
},
{
"cell_type": "markdown",
"source": [
"### **¿QUÉ ES PYTHON?**\n",
"\n",
"\n",
"<p><img src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/Guido_van_Rossum_OSCON_2006.jpg/1200px-Guido_van_Rossum_OSCON_2006.jpg\" alt=\"\" width=\"225\" height=\"320\" /></p>\n",
"\n",
"\n",
"Python es un lenguaje de programación de alto nivel, interpretado, de propósito general y con una sintaxis clara y legible. Fue creado por Guido van Rossum, un programador holandés, y la primera versión de Python se lanzó en 1991. Desde entonces, ha ganado una gran popularidad debido a su facilidad de uso, su enfoque en la legibilidad del código y su amplia comunidad de desarrolladores que han creado una gran cantidad de bibliotecas y módulos que facilitan el desarrollo de aplicaciones en diversos campos.\n",
"\n",
"[cuál versión usar](https://devguide.python.org/versions/)?\n"
],
"metadata": {
"id": "xWCkCH_mvpWH"
}
},
{
"cell_type": "markdown",
"source": [
"### **¿QUÉ ES UNA VARIABLE?**\n",
"\n",
"Una variable es un contenedor que se utiliza para almacenar y representar datos en memoria. Puedes pensar en una variable como una caja etiquetada en la que puedes poner un valor específico, y luego referirte a ese valor usando el nombre de la variable.\n",
"\n",
"\n",
"<p><img src=\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCnQzYw8GAj_eq6r2OR10JTYpw4RTQ93oSdpG1NB9KDrbsAyxT3HuDBlQUwBdfhg_w_k0jpuXLr4b9vECrNGv9ZegTlmEt668iQn3vuJc0VIy6DTzTWnByErxaAh3silXD67I6tqS3ekt4xkvUs3v6Urly0R9n4j5M6MLX6-9GxiJJfZdyiydrQ5AYQg/s800/image%20(15).webp\" alt=\"\" width=\"544\" height=\"233\" /></p>\n",
"\n",
"\n",
"Mirémoslo desde una mirada más simple:\n",
"<p><img src=\"https://img.yumpu.com/43636336/1/500x640/formulario-de-cambio-de-partidos-fecha-lugar-hora-federacian-.jpg\" alt=\"\" width=\"452\" height=\"640\" /></p>\n",
"\n",
"\n",
"\n",
"\n"
],
"metadata": {
"id": "Qfd8cIJFqysB"
}
},
{
"cell_type": "markdown",
"source": [
"### **¿QUÉ ES UN LENGUAJE DE PROGRAMACIÓN?**\n",
"\n",
"<p><img src=\"https://piperlab.es/wp-content/uploads/2020/09/lenguajes-de-programacion.jpg\" alt=\"\" width=\"544\" height=\"233\" /></p>\n",
"\n",
"\n",
"Un lenguaje de programación es como un conjunto de instrucciones que le das a una computadora para que realice tareas específicas. Puedes pensar en ello como si estuvieras dando una serie de pasos detallados y precisos a una persona para que realice una tarea.\n",
"\n",
"\n",
"Un lenguaje de programación consta de elementos como palabras clave, operadores, símbolos especiales, reglas de sintaxis y semántica, entre otros. Los programas escritos en un lenguaje de programación deben cumplir con las reglas y estructuras definidas en ese lenguaje para que sean comprensibles y ejecutables por la máquina.\n",
"\n",
"\n",
"\n"
],
"metadata": {
"id": "xEZYHmK5qymi"
}
},
{
"cell_type": "markdown",
"source": [
"## **CONOCIMIENTO DEL LENGUAJE DE PROGRAMACIÓN**\n",
"\n",
"\n",
"Las cinco preguntas que siempre se recomienda preguntar:"
],
"metadata": {
"id": "q-ifh44M-P84"
}
},
{
"cell_type": "markdown",
"source": [],
"metadata": {
"id": "4iRcfEIb-P44"
}
},
{
"cell_type": "markdown",
"source": [
"### **1.LENGUAJE COMPILADO O INTERPRETADO**\n",
"\n",
"\n",
"<p><img src=\"https://i.postimg.cc/FHg0cxb5/cmvsnocm.png\" alt=\"\" width=\"544\" height=\"233\" /></p>\n",
"\n"
],
"metadata": {
"id": "54HtHGcvclDa"
}
},
{
"cell_type": "markdown",
"source": [
"### **2.¿CUÁLES PARADIGMAS DE PROGRAMACIÓN MANEJA?**\n",
"\n",
"<p><img src=\"https://keepcoding.io/wp-content/uploads/2022/08/paradigmas-de-programacion.jpg\" alt=\"\" width=\"544\" height=\"233\" /></p>\n",
"\n",
"\n",
"\n",
"Para entenderlo veámoslo desde un punto de vista común:\n",
"<p><img src=\"https://i.postimg.cc/FzSV6dqj/pinturas.png\" alt=\"\" width=\"468\" height=\"146\" /></p>\n",
"\n",
"\n",
"\n",
"1. Acuarela.\n",
"2. Óleo.\n",
"3. Gouache.\n",
"4. Aerografía.\n",
"5. Pintura al pastel.\n",
"6. Temple o témpera.\n",
"7. Fresco.\n",
"8. Acrílico.\n",
"\n"
],
"metadata": {
"id": "acjdKdDeck9U"
}
},
{
"cell_type": "markdown",
"source": [
"#### **PROGRAMACIÓM IMPERATIVA**\n",
"\n",
"Python es un lenguaje imperativo en su núcleo, lo que significa que se ejecuta línea por línea, indicando cómo lograr el resultado paso a paso. Los programas en Python están compuestos principalmente por declaraciones y comandos que modifican el estado del programa.\n",
"\n",
"\n",
"\n",
"```python\n",
"def factorial_iterative(n):\n",
" result = 1\n",
" for i in range(1, n+1):\n",
" result *= i\n",
" return result\n",
"\n",
"print(factorial_iterative(5)) # Salida: 120\n",
"```\n",
"\n"
],
"metadata": {
"id": "d7cxBfBZhnzQ"
}
},
{
"cell_type": "markdown",
"source": [
"#### **PROGRAMACIÓN ORIENTADA A OBJETOS (OOP)**\n",
"\n",
" Python es un lenguaje orientado a objetos, lo que permite la definición de clases y objetos. Los objetos encapsulan datos y comportamientos, y las clases son plantillas que definen cómo se crean esos objetos. Python facilita la creación de objetos y el uso de herencia, polimorfismo y encapsulación.\n",
"\n",
"\n",
"\n",
"```python\n",
"class Persona:\n",
" def __init__(self, nombre, edad):\n",
" self.nombre = nombre\n",
" self.edad = edad\n",
"\n",
" def saludar(self):\n",
" return f\"Hola, mi nombre es {self.nombre} y tengo {self.edad} años.\"\n",
"\n",
"persona1 = Persona(\"Juan\", 30)\n",
"print(persona1.saludar()) # Salida: \"Hola, mi nombre es Juan y tengo 30 años.\"e\n",
"```\n",
"\n"
],
"metadata": {
"id": "LtqEPRioBRFw"
}
},
{
"cell_type": "markdown",
"source": [
"#### **PROGRAMACIÓN FUNCIONAL**\n",
"\n",
"Python admite programación funcional, que se centra en el uso de funciones como elementos de primer orden. Esto significa que las funciones pueden tratarse como cualquier otro objeto, lo que permite el uso de funciones anónimas (lambda), funciones de orden superior y operaciones de mapeo y reducción.\n",
"\n",
"\n",
"\n",
"```python\n",
"numeros = [1, 2, 3, 4, 5]\n",
"\n",
"# Usando funciones de orden superior\n",
"cuadrados = list(map(lambda x: x ** 2, numeros))\n",
"print(cuadrados) # Salida: [1, 4, 9, 16, 25]\n",
"\n",
"# Usando comprensiones de listas\n",
"cubos = [x ** 3 for x in numeros]\n",
"print(cubos) # Salida: [1, 8, 27, 64, 125]\n",
"```\n",
"\n"
],
"metadata": {
"id": "jMXBVjZrhntk"
}
},
{
"cell_type": "markdown",
"source": [
"#### **PROGRAMACIÓN PROCEDURAL**\n",
"\n",
"Python es adecuado para la programación procedural, que es un estilo de programación estructurado que divide el programa en procedimientos y subrutinas para resolver problemas.\n",
"\n",
"\n",
"\n",
"\n",
"```python\n",
"def suma(a, b):\n",
" return a + b\n",
"\n",
"resultado = suma(3, 5)\n",
"print(resultado) # Salida: 8\n",
"```\n",
"\n",
"\n"
],
"metadata": {
"id": "cYE5VzcFhnni"
}
},
{
"cell_type": "markdown",
"source": [
"### **3. LENGUAJE DE TIPADO DINÁMICO O ESTÁTICO**\n",
"\n",
"<p><img src=\"https://res.cloudinary.com/practicaldev/image/fetch/s--i1yqfSl1--/c_imagga_scale,f_auto,fl_progressive,h_900,q_auto,w_1600/https://miro.medium.com/max/1400/1%2ABddwVWW6hFU0miT9DCbUWQ.png\" alt=\"\" width=\"544\" height=\"233\" /></p>\n",
"\n"
],
"metadata": {
"id": "-2Vpz_aWhna0"
}
},
{
"cell_type": "markdown",
"source": [
"#### **ESTÁTICO O FUERTE**\n",
"\n",
"En un lenguaje tipado, también llamados de tipado estricto, se caracterizan porque requieren que definamos el tipo de dato específico de las variables y expresiones que vamos a utilizar.\n",
"\n",
"\n",
"```java\n",
"int numero = 5;\n",
"int resultado = numero + 10;\n",
"resultado = \"hola\"; // error\n",
"```\n",
"\n"
],
"metadata": {
"id": "VUhrOhxThnUI"
}
},
{
"cell_type": "markdown",
"source": [
"\n",
"#### **NO TIPADO O DINÁMICO**\n",
"En un lenguaje no tipado, también llamados de tipado dinámico, no necesitan que indiquemos el tipo de las variables y expresiones al declarar la variable.\n",
"\n",
"\n",
"\n",
"```python\n",
"numero = 5\n",
"resultado = numero + 10\n",
"resultado = \"hola\" # OK\n",
"```\n",
"\n"
],
"metadata": {
"id": "nzDsEqhDpYBK"
}
},
{
"cell_type": "markdown",
"source": [
"### **4. INDENTACIÓN DEL CÓDIGO**\n",
"\n",
"<p><img src=\"https://python.pages.doc.ic.ac.uk/java/lessons/java/01-intro/_images/guessing_game_braces.png\" alt=\"\" width=\"1365\" height=\"653\" /></p>\n",
"\n",
"\n",
"\n",
"---\n",
"\n"
],
"metadata": {
"id": "YMp9n6YMgIkn"
}
},
{
"cell_type": "markdown",
"source": [
"### **5. TIPOS DE DATOS QUE SOPORTA**\n",
"\n",
"En Python, existen varios tipos de datos que se utilizan para representar diferentes tipos de valores. Algunos de los tipos de datos más comunes en Python son los siguientes:\n",
"\n",
"### **Números**\n",
"\n",
"- **Enteros (int):** Representan números enteros positivos o negativos, por ejemplo, `1`, `100`, `-42`.\n",
"\n",
"- **Números de Punto Flotante (float):** Representan números con parte decimal, por ejemplo, `3.14`, `2.718`.\n",
"\n",
"\n",
"\n",
"- **Cadenas de caracteres (str):** Son secuencias de caracteres encerradas entre comillas, por ejemplo, `\"Hola, mundo\"`.\n",
"\n",
"\n",
"\n",
"- **Valores booleanos (bool):** Representan la verdad o la falsedad de una expresión. Pueden ser `True` o `False`.\n",
"\n",
"\n",
"- **Listas (list):** Son secuencias ordenadas de elementos que pueden ser de diferentes tipos, por ejemplo, `[1, 2, 3]`, `['a', 'b', 'c']`.\n",
"\n",
"\n",
"- **Tuplas (tuple):** Son secuencias ordenadas de elementos inmutables, por ejemplo, `(1, 2, 3)`.\n",
"\n",
"\n",
"- **Conjuntos (set):** Son colecciones no ordenadas de elementos únicos, por ejemplo, `{1, 2, 3}`.\n",
"\n",
"\n",
"- **Diccionarios (dict):** Son colecciones de pares clave-valor, por ejemplo, `{'nombre': 'Juan', 'edad': 30}`.\n",
"\n",
"\n",
"\n",
"- **None:** Es un tipo especial que representa la ausencia de valor, similar a `null` en otros lenguajes.\n",
"\n"
],
"metadata": {
"id": "BHGZYH_aBRDu"
}
},
{
"cell_type": "markdown",
"source": [
"## **¡MANOS A LA OBRA!**"
],
"metadata": {
"id": "5F6jxwLFwKv2"
}
},
{
"cell_type": "markdown",
"source": [
"### **VARIABLES**\n",
"Nota: las variables no pueden tener espacios\n",
"\n",
"nombres claros en las variables\n",
"\n",
"* No recomendado: `nombreCompleto`\n",
"* No recomendado: `NombreCompleTo`\n",
"* malo: `Nombre Completo`\n",
"* recomendado: `nombre_completo`\n",
"```\n",
"# nombre_variable: tipo = valor\n",
"```\n",
"\n"
],
"metadata": {
"id": "HDA6b1Mql4tT"
}
},
{
"cell_type": "markdown",
"source": [
"#### **HARCODEADO (HARDCODING)**\n",
"\n",
"**malas prácticas**\n",
"\n",
"profundizar"
],
"metadata": {
"id": "VHGUQSnBwGdh"
}
},
{
"cell_type": "code",
"source": [
"1"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "1oxZ4tGdwFfr",
"outputId": "f5eb0464-3eeb-477b-9302-95c8d47d6898"
},
"execution_count": 23,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"1"
]
},
"metadata": {},
"execution_count": 23
}
]
},
{
"cell_type": "markdown",
"source": [
"#### **SENCILLA**"
],
"metadata": {
"id": "GA0-I4DwmAbr"
}
},
{
"cell_type": "code",
"source": [
"nombre = 'coding up my future'\n",
"nombre"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"id": "mBVQnntdmQkg",
"outputId": "50177bd6-6e94-4086-d0dd-5594d00c0a99"
},
"execution_count": 5,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'coding up my future'"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "string"
}
},
"metadata": {},
"execution_count": 5
}
]
},
{
"cell_type": "code",
"source": [
"edad = 1"
],
"metadata": {
"id": "OxZ84ovemyDj"
},
"execution_count": 7,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"#### **REFERENCIA**\n",
"\n",
"Las variables de referencia no son restrictivas"
],
"metadata": {
"id": "VStVIHl_mAUX"
}
},
{
"cell_type": "code",
"source": [
"nombre: str = 'coding up my future'"
],
"metadata": {
"id": "J1TZy0vlpZhO"
},
"execution_count": 10,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# eje no restrictivo\n",
"nombre: int = 'hol@'"
],
"metadata": {
"id": "O00ol146pwf-"
},
"execution_count": 9,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"#### **CONSTRUCTOR**\n",
"\n",
"\n",
"Permite cambiar un tipo de dato a otro, siempre y cuando el origen de dato que se quiera convertir, lo soporte el destino\n",
"\n",
"para entender este concepto, estudiar casteos\n",
"\n"
],
"metadata": {
"id": "Ji4wI3eWmAP1"
}
},
{
"cell_type": "code",
"source": [
"edad: int = int('1')\n",
"edad"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "XB_JBIGZqb2E",
"outputId": "15df7788-2597-4578-91fa-fc3dc7626c0d"
},
"execution_count": 11,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"1"
]
},
"metadata": {},
"execution_count": 11
}
]
},
{
"cell_type": "code",
"source": [
"edad: int = int('1a')\n",
"edad"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 193
},
"id": "1dAuHnj9smen",
"outputId": "e0115219-4226-4a21-b8bf-824532efacca"
},
"execution_count": 12,
"outputs": [
{
"output_type": "error",
"ename": "ValueError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-12-2095daba3d90>\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0medad\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mint\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'1a'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0medad\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mValueError\u001b[0m: invalid literal for int() with base 10: '1a'"
]
}
]
},
{
"cell_type": "code",
"source": [
"edad: int = int('True')\n",
"edad"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 193
},
"id": "-TXHEOtBtWb5",
"outputId": "a9baf07e-137e-4036-e627-deed4e7dc32b"
},
"execution_count": 13,
"outputs": [
{
"output_type": "error",
"ename": "ValueError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-13-32a9fd69a5cc>\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0medad\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mint\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'True'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0medad\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mValueError\u001b[0m: invalid literal for int() with base 10: 'True'"
]
}
]
},
{
"cell_type": "code",
"source": [
"edad: str = float('1.2')\n",
"edad"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "lXG3blBotZJ3",
"outputId": "c2db9734-fa16-4ae1-ece6-96cd0c6e86f4"
},
"execution_count": 19,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"1.2"
]
},
"metadata": {},
"execution_count": 19
}
]
},
{
"cell_type": "markdown",
"source": [
"#### **TYPE**"
],
"metadata": {
"id": "KeHEq1ItuMY8"
}
},
{
"cell_type": "code",
"source": [
"type(edad)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "EB8IiGEBuKdv",
"outputId": "358966d4-286b-4251-e8d5-92c9a84b2eeb"
},
"execution_count": 20,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"float"
]
},
"metadata": {},
"execution_count": 20
}
]
},
{
"cell_type": "markdown",
"source": [
"#### **ISINSTANCE**"
],
"metadata": {
"id": "M8KO2_h2utHO"
}
},
{
"cell_type": "markdown",
"source": [
"##### **SIMPLE**"
],
"metadata": {
"id": "brjvMUycvAby"
}
},
{
"cell_type": "code",
"source": [
"isinstance(edad, str)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "wsLaOG9su22g",
"outputId": "a3f3a449-9531-4f16-c72d-f3db631fa1da"
},
"execution_count": 21,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"False"
]
},
"metadata": {},
"execution_count": 21
}
]
},
{
"cell_type": "markdown",
"source": [
"##### **MÚLTIPLE**"
],
"metadata": {
"id": "FMSYKNfkvCpb"
}
},
{
"cell_type": "code",
"source": [
"isinstance(edad, (str, float))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "CzTlgxTWvLDs",
"outputId": "397fdc2e-a582-4acb-f7b4-0b92bcd73035"
},
"execution_count": 22,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"True"
]
},
"metadata": {},
"execution_count": 22
}
]
},
{
"cell_type": "markdown",
"source": [
"### **IMPRIMIR (PRINT)**\n",
"\n",
"\n",
"comando `print`\n",
"\n",
"`print(object(s), sep=separator, end=end, file=file, flush=flush)`\n",
"\n",
"\n",
"Nota: solamente estudiar para evitar confusiones, la forma `simple`, `múltiple` y `sep` o `end`"
],
"metadata": {
"id": "da4Rz2YAvxvk"
}
},
{
"cell_type": "markdown",
"source": [
"#### **PRINT HARDCODEADO SIMPLE**"
],
"metadata": {
"id": "0N6v9BKRwcts"
}
},
{
"cell_type": "code",
"source": [
"print('coding up my future')"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "iwI_zI_BwcHQ",
"outputId": "52fb30d9-a65e-4b96-a2a2-04f35f5b962a"
},
"execution_count": 24,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"coding up my future\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"#### **VARIABLES SIMPLES**"
],
"metadata": {
"id": "AYfQwq6uwq1i"
}
},
{
"cell_type": "code",
"source": [
"nombre: str = 'coding up my future'\n",
"print(nombre)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "dJV0rvW8woUp",
"outputId": "34741e8c-7e8e-4ca6-b571-194e38dd9379"
},
"execution_count": 25,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"coding up my future\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"#### **PRINT HARDCODEADO MÚLTIPLE**\n",
"\n",
"valores separados por `,`\n",
"\n"
],
"metadata": {
"id": "2F_bEPYbw6uK"
}
},
{
"cell_type": "code",
"source": [
"print(1,2,3)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "qdxbMRb2w6S5",
"outputId": "9fd870e2-2e63-4ce0-e454-4461a72a971b"
},
"execution_count": 26,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"1 2 3\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"#### **PRINT VARIABLES MÚLTIPLES**"
],
"metadata": {
"id": "nAlNUCfwxLpg"
}
},
{
"cell_type": "code",
"source": [
"edad: int = 21\n",
"print(nombre, edad)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "PopVTD-vxPw2",
"outputId": "08a1158e-74e7-4420-9e1d-ab6856308269"
},
"execution_count": 27,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"coding up my future 21\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"#### **PRINT SEP**"
],
"metadata": {
"id": "H_RspflFxmNG"
}
},
{
"cell_type": "code",
"source": [
"print(1,2,3, sep=\"@@\")\n",
"print(1,2,3, sep=\"--\")\n",
"print(1,2,3, sep=\"\\n\")"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "ZYs_O_t0xlUe",
"outputId": "3587088c-01d9-4b91-a6ae-96c9ef8f9422"
},
"execution_count": 31,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"1@@2@@3\n",
"1--2--3\n",
"1\n",
"2\n",
"3\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"#### **PRINT END**"
],
"metadata": {
"id": "x0iH-E-TyBZL"
}
},
{
"cell_type": "code",
"source": [
"print(1,2,3, end=\"@@\")\n",
"print(1,2,3,sep=\"\\n\", end=\"termine!!!!\")"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "KkjIT-ZryDcm",
"outputId": "81acf028-7686-4afd-8c17-82cefd8d219a"
},
"execution_count": 33,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"1 2 3@@1\n",
"2\n",
"3termine!!!!"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"#### **PRINT FILE ELEMENTAL**\n",
"\n",
"Nota: carga todo a memoria (los prints) y cuando termina de evaluar todo, los escribe"
],
"metadata": {
"id": "oVz-pL55yZim"
}
},
{
"cell_type": "code",
"source": [
"with open(\"data.txt\", \"w\") as file:\n",
" print(1,2,3, sep=\"\\n\",file=file)"
],
"metadata": {
"id": "yJQxwvdVyi77"
},
"execution_count": 35,
"outputs": []
},
{
"cell_type": "code",
"source": [
"!ls -lrt"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "fyLd_yOmy-Uf",
"outputId": "cf5201ed-2e18-49f6-ba2a-e5fc54f0a980"
},
"execution_count": 36,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"total 8\n",
"drwxr-xr-x 1 root root 4096 Aug 2 13:34 sample_data\n",
"-rw-r--r-- 1 root root 6 Aug 3 23:46 data.txt\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"#### **PRINT FILE FLUSH**"
],
"metadata": {
"id": "Ii9h_3_Zzc5r"
}
},
{
"cell_type": "code",
"source": [
"import time\n",
"with open(\"luis.txt\", \"w\") as file:\n",
" print(1,2,3, sep=\"\\n\",file=file, flush=True)\n",
" time.sleep(40)\n",
" print(4,5,6, sep=\"\\n\",file=file, flush=True)"
],
"metadata": {
"id": "urYrj-Egzb_h"
},
"execution_count": 37,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# si no le ponen flush, miren lo que pasa\n",
"\n",
"import time\n",
"with open(\"final.txt\", \"w\") as file:\n",
" print(1,2,3, sep=\"\\n\",file=file)\n",
" time.sleep(40)\n",
" print(4,5,6, sep=\"\\n\",file=file)"
],
"metadata": {
"id": "AKjHgor30K9H"
},
"execution_count": 38,
"outputs": []
}
]
}
================================================
FILE: contenido.curso/003.recursos/LVL-1/LVL1.03.str.1.ipynb
================================================
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"source": [
"<p><img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"\" width=\"1280\" height=\"300\" /></p>"
],
"metadata": {
"id": "lOBmWT8kI0rK"
}
},
{
"cell_type": "markdown",
"source": [
"# **STRINGS (STR)**"
],
"metadata": {
"id": "sttmil0sJYf_"
}
},
{
"cell_type": "markdown",
"source": [
"## **HELP**"
],
"metadata": {
"id": "0IlHscnZPcOM"
}
},
{
"cell_type": "code",
"source": [
"help(str.upper)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "yKgXodhEPb4S",
"outputId": "4c68cc8d-d48a-440d-ffa8-88e783ea6e2d"
},
"execution_count": 6,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Help on method_descriptor:\n",
"\n",
"upper(self, /)\n",
" Return a copy of the string converted to uppercase.\n",
"\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## **INPUT**"
],
"metadata": {
"id": "oHyHAW8dNjbY"
}
},
{
"cell_type": "code",
"source": [
"nombre: str = input(\"ingrese nombre: \")\n",
"print(nombre)\n",
"print(\"tipo:\", type(nombre), \"valor:\",nombre)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "XClbDuE5NtJG",
"outputId": "2f26cee1-5235-47b6-9029-07092eae46f6"
},
"execution_count": 3,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"ingrese nombre: strings\n",
"strings\n",
"tipo: <class 'str'> valor: strings\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## **COMENTARIOS**"
],
"metadata": {
"id": "eTmLO00HNm2d"
}
},
{
"cell_type": "markdown",
"source": [
"### **SIMPLES**"
],
"metadata": {
"id": "xpYKTCU5Ohif"
}
},
{
"cell_type": "code",
"source": [
"# esto es un com simple"
],
"metadata": {
"id": "f_7jxyDoOnDI"
},
"execution_count": 10,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"### **MÚLTIPLES**"
],
"metadata": {
"id": "jUWWViBXOhfW"
}
},
{
"cell_type": "code",
"source": [
"\"\"\"\n",
"esto\n",
"es un\n",
"comentario\n",
"múltiple\n",
"\"\"\""
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"id": "sFTKLOdaPMPD",
"outputId": "f484128a-f76a-413c-c863-e58e1e4d8445"
},
"execution_count": 9,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'\\nesto\\nes un \\ncomentario\\nmúltiple\\n'"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "string"
}
},
"metadata": {},
"execution_count": 9
}
]
},
{
"cell_type": "code",
"source": [
"'''\n",
"esto\n",
"es un\n",
"comentario\n",
"múltiple\n",
"'''"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"id": "qNOa4JKlPZaK",
"outputId": "aa3ed6eb-eaa3-4013-86e3-da95290895a1"
},
"execution_count": 18,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'\\nesto\\nes un \\ncomentario\\nmúltiple\\n'"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "string"
}
},
"metadata": {},
"execution_count": 18
}
]
},
{
"cell_type": "markdown",
"source": [
"## **COMILLAS SIMPLES Y DOBLES**\n",
"\n",
"Quieren que el texto les salga con comillas simples,la cadena debe estar encerrada por dobles, y si quieren dobles, deben estar encerradas por simples"
],
"metadata": {
"id": "URakvMjuNm0G"
}
},
{
"cell_type": "markdown",
"source": [
"### **SIMPLE**"
],
"metadata": {
"id": "wDWuHKdfNmxp"
}
},
{
"cell_type": "code",
"source": [
"nombre: str = 'Algo'\n",
"apellido: str = 'cómo le va señor \"Vásquez\"'\n",
"print(apellido)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "CtCAIkPoRQpX",
"outputId": "a55cdf39-8808-4fa8-bda2-79215fa84823"
},
"execution_count": 14,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"cómo le va señor \"Vásquez\"\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **DOBLES**"
],
"metadata": {
"id": "93cPLjoVNmvE"
}
},
{
"cell_type": "code",
"source": [
"nombre: str = \"Algo\"\n",
"apellido: str = \"cómo le va señor 'Vásquez'\"\n",
"print(apellido)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "8q4Tm9ImRWF2",
"outputId": "0d2cd285-c720-40e9-b474-24997ab55bea"
},
"execution_count": 15,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"cómo le va señor 'Vásquez'\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"pepito_julanito: str = \"Algo\"\n",
"print(apellido)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "3mZ7OBUNTrXN",
"outputId": "05ceb358-3cbc-481e-a70f-88e41b6356c8"
},
"execution_count": 19,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"como le va señor 'vasquez'\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **EJEMPLO**"
],
"metadata": {
"id": "Q8gyAy_0Nmsi"
}
},
{
"cell_type": "code",
"source": [
"print(\"email:str = 'pepito@gmail.com'\")\n",
"print(\"print(email)\")"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "udrk1jBjSNxL",
"outputId": "ebb79a4a-c817-4f25-962e-ada7bc2b34f1"
},
"execution_count": 16,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"email:str = 'pepito@gmail.com'\n",
"print(email)\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"email:str = 'pepito@gmail.com'\n",
"print(email)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "sVEYMu6xSf_j",
"outputId": "109819d1-6157-4c48-cddb-19434f85e772"
},
"execution_count": 17,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"pepito@gmail.com\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## **SLICES**\n",
"\n",
"Manipular elementos de una lista de diferentes formas:\n",
"\n",
"1. strings\n",
"2. listas\n",
"3. tuplcas\n",
"\n",
"Los strings en python se manejan como iterables para obtener valores\n",
"\n",
"\n",
"\n",
"```\n",
"variable[rango_inicial: rango_final:saltos]\n",
"HOLA\n",
"[H | O | L | A]\n",
"[0 | 1 | 2 | 3] -- postivo\n",
"[-4 | -3 | -2 | -1] -- negativa\n",
"```\n",
"\n",
"cuando yo trabajo con iterables, el índice empieza en cero\n"
],
"metadata": {
"id": "oD0B-_9ENmqJ"
}
},
{
"cell_type": "code",
"source": [
"curso: str = \"CoDinG.Up.My.Future\""
],
"metadata": {
"id": "Hp-mVAUQVObe"
},
"execution_count": 37,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"## **ÍNDICE POSITIVO**\n",
"\n",
"Obtiene un solo valor"
],
"metadata": {
"id": "aPWn_EeNWVBm"
}
},
{
"cell_type": "code",
"source": [
"print(curso[5])\n",
"print(\"positivo\", curso[12])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Eb9t6KaxVbpJ",
"outputId": "3ffcfbd0-1164-45f1-e9f8-26d5c9e5238e"
},
"execution_count": 25,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
".\n",
"postivo F\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## **ÍNDICE NEGATIVO**"
],
"metadata": {
"id": "EarcPWgONmnk"
}
},
{
"cell_type": "code",
"source": [
"print(\"negativo\", curso[-6])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "p60py94CYi4B",
"outputId": "b871809a-2b10-4ab3-a4a6-29a408dc4e06"
},
"execution_count": 26,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"negativo F\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## **RANGOS**\n",
"\n",
"`rango[inicia:final -1]`\n",
"\n",
"```\n",
"CoDinG.Up.My.Future\n",
"```\n",
"\n"
],
"metadata": {
"id": "HMo53DyoNmlJ"
}
},
{
"cell_type": "markdown",
"source": [
"### **INICIAL**"
],
"metadata": {
"id": "A5Lw7z7MZbcV"
}
},
{
"cell_type": "code",
"source": [
"print(curso[0: 6])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "rhHwKbH1Yt2w",
"outputId": "37f68c1f-5de5-46d5-ba90-ad3b129b16bd"
},
"execution_count": 52,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG.\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(curso[: 5])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "QecA-excYtz_",
"outputId": "dd84f6a0-3e95-4269-db68-68ef26a8eb19"
},
"execution_count": 29,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **FINAL**"
],
"metadata": {
"id": "tQniRHJYZhxG"
}
},
{
"cell_type": "code",
"source": [
"print(curso[5: 7])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "7z0PTkcTYtwb",
"outputId": "c2d4174e-82ac-44dc-de43-618319287796"
},
"execution_count": 31,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
".U\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(curso[5: ])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "O3MH_wRsZzNl",
"outputId": "8214b1af-131b-4894-d8c1-8a7edb616102"
},
"execution_count": 32,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
".Up.My.Future\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(curso[-5: -2])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "oZrDDqU2avag",
"outputId": "c657704d-c39d-416b-84ae-dcd7121817ee"
},
"execution_count": 43,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"utu\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **EJEMPLO**\n",
"\n",
"\n",
"\n",
"```\n",
"estoy en el bootcamp con Ruta N #SSCodingupmyfuture\n",
"```\n",
"\n"
],
"metadata": {
"id": "QUUg_5kVZ4dX"
}
},
{
"cell_type": "code",
"source": [
"hashtag: str = \"estoy en el bootcamp con Ruta N #SSCodingupmyfuture\"\n",
"print(hashtag[32:])\n",
"print(hashtag[-19:])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "wH98O3SkZ3TG",
"outputId": "47e8758a-b660-4f80-f1c7-c529464221e0"
},
"execution_count": 34,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"#SSCodingupmyfuture\n",
"#SSCodingupmyfuture\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **RANGOS**\n",
"\n",
"\n",
"\n",
"```\n",
"CoDinG.Up.My.Future\n",
"```\n",
"\n"
],
"metadata": {
"id": "0FkEJ0tkNmiy"
}
},
{
"cell_type": "code",
"source": [
"print(curso[::])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "yj2Hm8xrb-Vy",
"outputId": "69a58835-4f26-4290-9303-77932ad9d2c5"
},
"execution_count": 51,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG.Up.My.Future\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(curso[::2])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "zBixut2ccKTw",
"outputId": "733b5fbe-ed43-4277-8d0e-90ed04e4ea06"
},
"execution_count": 47,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CDGU.yFtr\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(curso[::3])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "z2bcLJxQcXbc",
"outputId": "c490c6f6-c7e3-420f-ac5d-b7c0d1ffcf2e"
},
"execution_count": 48,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CiUMFu\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(curso[::-1])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "keSMzDXgcd8K",
"outputId": "dd07a8c6-2c83-4269-d283-83a7bb3e6630"
},
"execution_count": 53,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"oC\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# iG.Up.My\n",
"print(curso[3:10:2])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "tM72iKKBcv18",
"outputId": "98e3535c-ec62-4381-d8b4-b2a4768c3650"
},
"execution_count": 50,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"i.pM\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## **PRINCIPALES OPERACIONES DE LOS STRINGS**"
],
"metadata": {
"id": "NwKyX5vRNmd_"
}
},
{
"cell_type": "code",
"source": [
"curso: str = \"CoDinG.Up.My.Future\"\n",
"espacios_izquierda = ' hola espacios izquierdos'\n",
"espacios_derecha = 'hola espacios derechos '\n",
"espacios_ambos =' espacio central '"
],
"metadata": {
"id": "9v_FTa3efKly"
},
"execution_count": 66,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"### **LOWER**"
],
"metadata": {
"id": "tnQZ-eeCNmbW"
}
},
{
"cell_type": "code",
"source": [
"print(curso.lower())\n",
"alterna = curso.lower()\n",
"print(alterna)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Xn-QFyVPflN0",
"outputId": "7effb8e0-b09e-439f-f813-85546a205c76"
},
"execution_count": 56,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"coding.up.my.future\n",
"coding.up.my.future\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **UPPER**"
],
"metadata": {
"id": "NS3tSiuDi_ex"
}
},
{
"cell_type": "code",
"source": [
"print(curso)\n",
"print(curso.upper())"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "K2ZWNsIkjDGi",
"outputId": "340d631e-8762-4da0-ffbc-7e10ea0e120c"
},
"execution_count": 68,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG.Up.My.Future\n",
"CODING.UP.MY.FUTURE\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **STARTSWITH**"
],
"metadata": {
"id": "ePUVg5ZeNmZK"
}
},
{
"cell_type": "code",
"source": [
"print(curso)\n",
"print(curso.startswith(\"C\"))\n",
"print(curso.startswith(\"c\"))\n",
"print(\"CC:121212;nombre;genero\".startswith(\"CC\"))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "k-GGFQHbgYQO",
"outputId": "e80d16b8-b2bd-4dd8-8a92-f216ca210121"
},
"execution_count": 64,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG.Up.My.Future\n",
"True\n",
"False\n",
"True\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **CONCATENACIÓN DE OPERACIONES**"
],
"metadata": {
"id": "ylc3zMDANmWp"
}
},
{
"cell_type": "markdown",
"source": [
"### **LARGO**"
],
"metadata": {
"id": "T5KCL4aZhmLs"
}
},
{
"cell_type": "code",
"source": [
"curso_minuscula: str = curso.lower()\n",
"print(curso_minuscula.startswith(\"c\"))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "HAWfO-_KhlxP",
"outputId": "b1a35cc1-fb0c-4818-a845-17631ea1d73f"
},
"execution_count": 65,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"True\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **CORTO**"
],
"metadata": {
"id": "1IJDjeSnNmUM"
}
},
{
"cell_type": "code",
"source": [
"\"\"\"\n",
"1. curso.lower() = coding.up.my.future\n",
"2. coding.up.my.future y evalúa si empieza con C\n",
"\"\"\"\n",
"print(curso.lower().startswith(\"c\"))"
],
"metadata": {
"id": "wiBiT4BDh-8q"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"### **CAPITALIZE**"
],
"metadata": {
"id": "WmGXJmviNmR0"
}
},
{
"cell_type": "code",
"source": [
"print(curso)\n",
"print(curso.capitalize())\n",
"print(\"coding up my future\".capitalize())"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "RN8CiHJOjXpQ",
"outputId": "3f5e0462-ee76-4632-99af-132469895ee3"
},
"execution_count": 84,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG.Up.My.Future\n",
"Coding.up.my.future\n",
"Coding up my future\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **TITLE**"
],
"metadata": {
"id": "Ejd5h6gWNmPQ"
}
},
{
"cell_type": "code",
"source": [
"print(curso)\n",
"print(curso.title())\n",
"print(\"title-->\",\"coding up my future\".title())"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "MtxvrgOyjmXJ",
"outputId": "7cd630d0-cfdc-48ac-971f-da676f6d3b1f"
},
"execution_count": 83,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG.Up.My.Future\n",
"Coding.Up.My.Future\n",
"title--> Coding Up My Future\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **CENTER**\n",
"\n",
"\n",
"\n",
"\n",
"```\n",
"**********hola********\n",
"```\n",
"\n"
],
"metadata": {
"id": "u-KitOObj90O"
}
},
{
"cell_type": "code",
"source": [
"help(str.center)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "S546iXA9ljXE",
"outputId": "9aa4e7f1-ebe9-481d-c90c-bdc1c52cba81"
},
"execution_count": 82,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Help on method_descriptor:\n",
"\n",
"center(self, width, fillchar=' ', /)\n",
" Return a centered string of length width.\n",
" \n",
" Padding is done using the specified fill character (default is a space).\n",
"\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(curso)\n",
"print(curso.lower().center(50, \"*\"))\n",
"print(curso.lower().center(50, \"@\"))\n",
"print(curso.lower().center(50, \" \"))\n",
"print(curso[-6:].lower().center(50, \" \"))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "MEgcMj75j7GC",
"outputId": "6e8a975e-6b9d-4eb4-9ae1-a78bb8418404"
},
"execution_count": 81,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG.Up.My.Future\n",
"****************coding.up.my.future****************\n",
"@@@@@@@@@@@@@@@@coding.up.my.future@@@@@@@@@@@@@@@@\n",
" coding.up.my.future \n",
" future \n"
]
}
]
}
]
}
================================================
FILE: contenido.curso/003.recursos/LVL-1/LVL1.04.str.2.ipynb
================================================
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"toc_visible": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"source": [
"<p><img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"\" width=\"1280\" height=\"300\" /></p>"
],
"metadata": {
"id": "lOBmWT8kI0rK"
}
},
{
"cell_type": "markdown",
"source": [
"# **STRINGS (STR)**"
],
"metadata": {
"id": "sttmil0sJYf_"
}
},
{
"cell_type": "markdown",
"source": [
"## **HELP**"
],
"metadata": {
"id": "0IlHscnZPcOM"
}
},
{
"cell_type": "code",
"source": [
"help(str.upper)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "yKgXodhEPb4S",
"outputId": "dcab0acb-b88d-4d6a-c6f0-c6d70b7868b2"
},
"execution_count": 6,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Help on method_descriptor:\n",
"\n",
"upper(self, /)\n",
" Return a copy of the string converted to uppercase.\n",
"\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## **INPUT**"
],
"metadata": {
"id": "oHyHAW8dNjbY"
}
},
{
"cell_type": "code",
"source": [
"nombre: str = input(\"ingrese nombre: \")\n",
"print(nombre)\n",
"print(\"tipo:\", type(nombre), \"valor:\",nombre)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "XClbDuE5NtJG",
"outputId": "5e19367f-a06d-4120-a8d1-619d3ed7543d"
},
"execution_count": 7,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"ingrese nombre: luis\n",
"luis\n",
"tipo: <class 'str'> valor: luis\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## **COMENTARIOS**"
],
"metadata": {
"id": "eTmLO00HNm2d"
}
},
{
"cell_type": "markdown",
"source": [
"### **SIMPLES**"
],
"metadata": {
"id": "xpYKTCU5Ohif"
}
},
{
"cell_type": "code",
"source": [
"# esto es un com simple"
],
"metadata": {
"id": "f_7jxyDoOnDI"
},
"execution_count": 8,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"### **MÚLTIPLES**"
],
"metadata": {
"id": "jUWWViBXOhfW"
}
},
{
"cell_type": "code",
"source": [
"\"\"\"\n",
"esto\n",
"es un\n",
"comentario\n",
"múltiple\n",
"\"\"\""
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"id": "sFTKLOdaPMPD",
"outputId": "ec081c30-7abb-40fa-c6a9-47798de040f2"
},
"execution_count": 9,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'\\nesto\\nes un\\ncomentario\\nmúltiple\\n'"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "string"
}
},
"metadata": {},
"execution_count": 9
}
]
},
{
"cell_type": "code",
"source": [
"'''\n",
"esto\n",
"es un\n",
"comentario\n",
"múltiple\n",
"'''"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"id": "qNOa4JKlPZaK",
"outputId": "466a6f3a-233f-4097-c6dd-c8235a8d462a"
},
"execution_count": 10,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'\\nesto\\nes un\\ncomentario\\nmúltiple\\n'"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "string"
}
},
"metadata": {},
"execution_count": 10
}
]
},
{
"cell_type": "markdown",
"source": [
"## **COMILLAS SIMPLES Y DOBLES**\n",
"\n",
"Quieren que el texto les salga con comillas simples, la cadena debe estar encerrada por dobles, y si quieren dobles, deben estar encerradas por simples"
],
"metadata": {
"id": "URakvMjuNm0G"
}
},
{
"cell_type": "markdown",
"source": [
"### **SIMPLE**"
],
"metadata": {
"id": "wDWuHKdfNmxp"
}
},
{
"cell_type": "code",
"source": [
"nombre: str = 'Algo'\n",
"apellido: str = 'cómo le va señor \"Vásquez\"'\n",
"print(apellido)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "CtCAIkPoRQpX",
"outputId": "4f550259-3db2-4a7c-dafd-8f65cff76270"
},
"execution_count": 11,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"cómo le va señor \"Vásquez\"\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **DOBLES**"
],
"metadata": {
"id": "93cPLjoVNmvE"
}
},
{
"cell_type": "code",
"source": [
"nombre: str = \"Algo\"\n",
"apellido: str = \"cómo le va señor 'Vásquez'\"\n",
"print(apellido)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "8q4Tm9ImRWF2",
"outputId": "71262259-5101-4203-a5be-f88098b0c4ce"
},
"execution_count": 12,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"cómo le va señor 'Vásquez'\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"pepito_julanito: str = \"Algo\"\n",
"print(apellido)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "3mZ7OBUNTrXN",
"outputId": "289d6766-6982-4c93-949a-2ed4b74f2d75"
},
"execution_count": 13,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"cómo le va señor 'Vásquez'\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **EJEMPLO**"
],
"metadata": {
"id": "Q8gyAy_0Nmsi"
}
},
{
"cell_type": "code",
"source": [
"print(\"email:str = 'pepito@gmail.com'\")\n",
"print(\"print(email)\")"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "udrk1jBjSNxL",
"outputId": "49743487-d8fa-4555-d68d-f368693b2551"
},
"execution_count": 14,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"email:str = 'pepito@gmail.com'\n",
"print(email)\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"email:str = 'pepito@gmail.com'\n",
"print(email)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "sVEYMu6xSf_j",
"outputId": "16443b6e-d346-4677-a533-a39cc6e789fe"
},
"execution_count": 15,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"pepito@gmail.com\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## **SLICES**\n",
"\n",
"Manipular elementos de una lista de diferentes formas:\n",
"\n",
"1. strings\n",
"2. listas\n",
"3. tuplas\n",
"\n",
"Los strings en python se manejan como iterables para obtener valores\n",
"\n",
"\n",
"\n",
"```\n",
"variable[rango_inicial: rango_final:saltos]\n",
"HOLA\n",
"[H | O | L | A]\n",
"[0 | 1 | 2 | 3] -- postivo\n",
"[-4 | -3 | -2 | -1] -- negativa\n",
"```\n",
"\n",
"cuando yo trabajo con iterables, el índice empieza en cero\n"
],
"metadata": {
"id": "oD0B-_9ENmqJ"
}
},
{
"cell_type": "code",
"source": [
"curso: str = \"CoDinG.Up.My.Future\""
],
"metadata": {
"id": "Hp-mVAUQVObe"
},
"execution_count": 16,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"## **ÍNDICE POSITIVO**\n",
"\n",
"Obtiene un solo valor"
],
"metadata": {
"id": "aPWn_EeNWVBm"
}
},
{
"cell_type": "code",
"source": [
"print(curso[5])\n",
"print(\"positivo\", curso[12])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Eb9t6KaxVbpJ",
"outputId": "bddaf07e-b184-4054-b008-5e2c69f1c96d"
},
"execution_count": 17,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"G\n",
"positivo .\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## **ÍNDICE NEGATIVO**"
],
"metadata": {
"id": "EarcPWgONmnk"
}
},
{
"cell_type": "code",
"source": [
"print(\"negativo\", curso[-6])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "p60py94CYi4B",
"outputId": "1873d1d9-2b28-402b-9e10-e9a993156846"
},
"execution_count": 18,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"negativo F\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## **RANGOS**\n",
"\n",
"`rango[inicia:final -1]`\n",
"\n",
"```\n",
"CoDinG.Up.My.Future\n",
"```\n",
"\n"
],
"metadata": {
"id": "HMo53DyoNmlJ"
}
},
{
"cell_type": "markdown",
"source": [
"### **INICIAL**"
],
"metadata": {
"id": "A5Lw7z7MZbcV"
}
},
{
"cell_type": "code",
"source": [
"print(curso[0: 6])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "rhHwKbH1Yt2w",
"outputId": "c3ef0c46-54bb-4a43-9176-03738c975977"
},
"execution_count": 19,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(curso[: 5])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "QecA-excYtz_",
"outputId": "daea0da5-2014-4538-9c45-6e1e6e0b626c"
},
"execution_count": 20,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDin\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **FINAL**"
],
"metadata": {
"id": "tQniRHJYZhxG"
}
},
{
"cell_type": "code",
"source": [
"print(curso[5: 7])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "7z0PTkcTYtwb",
"outputId": "c7148c53-7486-4d50-8287-3c242b761a41"
},
"execution_count": 21,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"G.\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(curso[5: ])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "O3MH_wRsZzNl",
"outputId": "96ee3c9e-57dd-496f-ee3c-6d91257b3724"
},
"execution_count": 22,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"G.Up.My.Future\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(curso[-5: -2])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "oZrDDqU2avag",
"outputId": "ef327f68-8185-4b44-d04b-827974c12085"
},
"execution_count": 23,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"utu\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **EJEMPLO**\n",
"\n",
"\n",
"\n",
"```\n",
"estoy en el bootcamp con Ruta N #SSCodingupmyfuture\n",
"```\n",
"\n"
],
"metadata": {
"id": "QUUg_5kVZ4dX"
}
},
{
"cell_type": "code",
"source": [
"hashtag: str = \"estoy en el bootcamp con Ruta N #SSCodingupmyfuture\"\n",
"print(hashtag[32:])\n",
"print(hashtag[-19:])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "wH98O3SkZ3TG",
"outputId": "6e953901-de28-4d44-e735-87721e4963c1"
},
"execution_count": 24,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"#SSCodingupmyfuture\n",
"#SSCodingupmyfuture\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **RANGOS**\n",
"\n",
"\n",
"\n",
"```\n",
"CoDinG.Up.My.Future\n",
"```\n",
"\n"
],
"metadata": {
"id": "0FkEJ0tkNmiy"
}
},
{
"cell_type": "code",
"source": [
"print(curso[::])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "yj2Hm8xrb-Vy",
"outputId": "5079a249-c455-4d56-9cb6-5c71a9cd1eb1"
},
"execution_count": 25,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG.Up.My.Future\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(curso[::2])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "zBixut2ccKTw",
"outputId": "42621975-ff36-40a2-ef0d-4a4758005250"
},
"execution_count": 26,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CDn.pM.uue\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(curso[::3])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "z2bcLJxQcXbc",
"outputId": "f4c4d9bc-3732-4f80-a304-7e25fb5c5e5c"
},
"execution_count": 27,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Ci...te\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(curso[::-1])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "keSMzDXgcd8K",
"outputId": "03dc1f04-b354-43b7-fd1d-7543a989be19"
},
"execution_count": 28,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"erutuF.yM.pU.GniDoC\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# iG.Up.My\n",
"print(curso[3:10:2])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "tM72iKKBcv18",
"outputId": "efd62b26-349d-419e-f268-d0ff817eba19"
},
"execution_count": 29,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"iGU.\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## **PRINCIPALES OPERACIONES DE LOS STRINGS**"
],
"metadata": {
"id": "NwKyX5vRNmd_"
}
},
{
"cell_type": "code",
"source": [
"curso: str = \"CoDinG.Up.My.Future\"\n",
"espacios_izquierda = ' hola espacios izquierdos'\n",
"espacios_derecha = 'hola espacios derechos '\n",
"espacios_ambos =' espacio central '"
],
"metadata": {
"id": "9v_FTa3efKly"
},
"execution_count": 30,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"### **LOWER**"
],
"metadata": {
"id": "tnQZ-eeCNmbW"
}
},
{
"cell_type": "code",
"source": [
"print(curso.lower())\n",
"alterna = curso.lower()\n",
"print(alterna)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Xn-QFyVPflN0",
"outputId": "12ccd7ce-f814-4f16-a734-448256541359"
},
"execution_count": 31,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"coding.up.my.future\n",
"coding.up.my.future\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **UPPER**"
],
"metadata": {
"id": "NS3tSiuDi_ex"
}
},
{
"cell_type": "code",
"source": [
"print(curso)\n",
"print(curso.upper())"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "K2ZWNsIkjDGi",
"outputId": "63eee2c5-0eb8-4d0c-9e0c-e73a9b9badea"
},
"execution_count": 32,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG.Up.My.Future\n",
"CODING.UP.MY.FUTURE\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **STARTSWITH**"
],
"metadata": {
"id": "ePUVg5ZeNmZK"
}
},
{
"cell_type": "code",
"source": [
"print(curso)\n",
"print(curso.startswith(\"C\"))\n",
"print(curso.startswith(\"c\"))\n",
"print(\"CC:121212;nombre;genero\".startswith(\"CC\"))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "k-GGFQHbgYQO",
"outputId": "1a536488-3689-4fdf-fb73-e74d091c2414"
},
"execution_count": 33,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG.Up.My.Future\n",
"True\n",
"False\n",
"True\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **CONCATENACIÓN DE OPERACIONES**"
],
"metadata": {
"id": "ylc3zMDANmWp"
}
},
{
"cell_type": "markdown",
"source": [
"### **LARGO**"
],
"metadata": {
"id": "T5KCL4aZhmLs"
}
},
{
"cell_type": "code",
"source": [
"curso_minuscula: str = curso.lower()\n",
"print(curso_minuscula.startswith(\"c\"))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "HAWfO-_KhlxP",
"outputId": "2dabb6eb-9ae1-4c98-f18c-70cf266da3c2"
},
"execution_count": 34,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"True\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **CORTO**"
],
"metadata": {
"id": "1IJDjeSnNmUM"
}
},
{
"cell_type": "code",
"source": [
"\"\"\"\n",
"1. curso.lower() = coding.up.my.future\n",
"2. coding.up.my.future y evalúa si empieza con C\n",
"\"\"\"\n",
"print(curso.lower().startswith(\"c\"))"
],
"metadata": {
"id": "wiBiT4BDh-8q",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "a140100a-8a6a-46a6-edf0-50000e33b482"
},
"execution_count": 35,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"True\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **CAPITALIZE**"
],
"metadata": {
"id": "WmGXJmviNmR0"
}
},
{
"cell_type": "code",
"source": [
"print(curso)\n",
"print(curso.capitalize())\n",
"print(\"coding up my future\".capitalize())"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "RN8CiHJOjXpQ",
"outputId": "e501aafd-bfc6-43d4-9fcd-e7284c08fe81"
},
"execution_count": 36,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG.Up.My.Future\n",
"Coding.up.my.future\n",
"Coding up my future\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **TITLE**"
],
"metadata": {
"id": "Ejd5h6gWNmPQ"
}
},
{
"cell_type": "code",
"source": [
"print(curso)\n",
"print(curso.title())\n",
"print(\"title-->\",\"coding up my future\".title())"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "MtxvrgOyjmXJ",
"outputId": "4579beca-d5cd-4975-fdf1-e45135365358"
},
"execution_count": 37,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG.Up.My.Future\n",
"Coding.Up.My.Future\n",
"title--> Coding Up My Future\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **CENTER**\n",
"\n",
"\n",
"\n",
"\n",
"```\n",
"**********hola********\n",
"```\n",
"\n"
],
"metadata": {
"id": "u-KitOObj90O"
}
},
{
"cell_type": "code",
"source": [
"help(str.center)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "S546iXA9ljXE",
"outputId": "4960b096-acee-421f-e588-df755061ae59"
},
"execution_count": 38,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Help on method_descriptor:\n",
"\n",
"center(self, width, fillchar=' ', /)\n",
" Return a centered string of length width.\n",
" \n",
" Padding is done using the specified fill character (default is a space).\n",
"\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(curso)\n",
"print(curso.lower().center(50, \"*\"))\n",
"print(curso.lower().center(50, \"@\"))\n",
"print(curso.lower().center(50, \" \"))\n",
"print(curso[-6:].lower().center(50, \" \"))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "MEgcMj75j7GC",
"outputId": "b9bdbe22-35fe-4055-e50a-5aa1a8f942c0"
},
"execution_count": 39,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG.Up.My.Future\n",
"***************coding.up.my.future****************\n",
"@@@@@@@@@@@@@@@coding.up.my.future@@@@@@@@@@@@@@@@\n",
" coding.up.my.future \n",
" future \n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **LEN**\n",
"\n",
"\n",
"\n",
"1. str\n",
"2. list\n",
"3. tuple\n",
"\n"
],
"metadata": {
"id": "dSm4ngqJhzYz"
}
},
{
"cell_type": "code",
"source": [
"print(len(\" \"))\n",
"print(len(curso))\n",
"print(curso)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "9OWWuogniH3V",
"outputId": "36dc3106-0c9c-4fff-8096-9267a0cf5f64"
},
"execution_count": 40,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"1\n",
"19\n",
"CoDinG.Up.My.Future\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **RJUST**"
],
"metadata": {
"id": "DURJH0GWi7im"
}
},
{
"cell_type": "code",
"source": [
"print(curso.rjust(50, \"*\"))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "WvnRQyn0i7LX",
"outputId": "34978baa-646b-4fce-863c-4cc6cebf128e"
},
"execution_count": 41,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"*******************************CoDinG.Up.My.Future\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **LJUST**"
],
"metadata": {
"id": "ZlZepVG0i-DO"
}
},
{
"cell_type": "code",
"source": [
"print(curso.ljust(50, \"*\"))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "9i4qrUiCjhaS",
"outputId": "02515b3f-6078-40ad-9910-33cb1db43e72"
},
"execution_count": 42,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG.Up.My.Future*******************************\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **ZFILL**"
],
"metadata": {
"id": "H8NjpjAjjApH"
}
},
{
"cell_type": "code",
"source": [
"# 000010000\n",
"# 000000500\n",
"print(curso.zfill(50))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "IqLYBdDLj2WD",
"outputId": "b896c9ff-8fd1-4ade-d509-4996144b457e"
},
"execution_count": 43,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"0000000000000000000000000000000CoDinG.Up.My.Future\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **REPLACE**"
],
"metadata": {
"id": "fMagcoOmkl45"
}
},
{
"cell_type": "code",
"source": [
"print(\"texto que entra: \",curso)\n",
"print(\"texto que sale : \",curso.lower().replace(\"u\", \"@\")) # transformar u por. @"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Mep4GJOXlDVI",
"outputId": "991f5599-fe53-42f1-c822-67afc0e489ac"
},
"execution_count": 44,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"texto que entra: CoDinG.Up.My.Future\n",
"texto que sale : coding.@p.my.f@t@re\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# quitar espacios\n",
"print(espacios_ambos.replace(\" \", \"\"))"
],
"metadata": {
"id": "iEvQ8yXsr28f",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "7804d464-99e5-41c8-8b19-cf5bf09025a0"
},
"execution_count": 45,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"espaciocentral\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# quitar espacios\n",
"# \\n -- enter\n",
"# \\t -- tabular\n",
"# alt + 64 -- ascii\n",
"texto_multi_linea:str = \"\"\"\n",
"hola\n",
"como\n",
"están\n",
"1 2\n",
"\"\"\"\n",
"print(texto_multi_linea.replace(\" \", \"\").replace(\"\\n\", \"\"))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "tr3hJ0bVr25p",
"outputId": "257bb581-84d8-47d4-e00b-bd44d65ece9e"
},
"execution_count": 46,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"holacomoestán12\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **COUNT**"
],
"metadata": {
"id": "eDAYZ7LTkl18"
}
},
{
"cell_type": "code",
"source": [
"print(\"texto que entra: \",curso)\n",
"print(\"texto que sale : \",curso.count(\"u\"))\n",
"print(\"texto que sale : \",curso.lower().count(\"n.\"))\n",
"print(\"texto que sale : \",\"0000000121231231|CC1231312312\".count(\"CC\"))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "_OOCkqUAl4Ys",
"outputId": "fdf1d83e-51c1-4651-99f8-b46a88e3f479"
},
"execution_count": 47,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"texto que entra: CoDinG.Up.My.Future\n",
"texto que sale : 2\n",
"texto que sale : 0\n",
"texto que sale : 1\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(\"texto que sale : \",\"0000000121231231|CC1231312312\".count(\"NIT\"))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "6oH1l5Trm6Yt",
"outputId": "467db66e-6355-476d-ebc5-93f12e3955e9"
},
"execution_count": 48,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"texto que sale : 0\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **FIND**\n",
"\n",
"Mirar esta función, es ideal para slices\n",
"\n",
"\n",
"cuando retorna -1 : no encontró el caracter"
],
"metadata": {
"id": "nbYBqZrTklze"
}
},
{
"cell_type": "code",
"source": [
"print(\"texto que entra: \",curso)\n",
"print(\"texto que sale : \",curso.find(\"u\"))\n",
"print(\"texto que sale : \",curso.lower().find(\"u\"))\n",
"print(\"texto que sale : \",curso[curso.lower().find(\"u\"):])\n",
"print(\"texto que sale : \",curso.lower().find(\"X\"))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "q_1yGU8Dm9D5",
"outputId": "06c03b91-dfe8-42e6-93c0-bdcbcd68f9e7"
},
"execution_count": 49,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"texto que entra: CoDinG.Up.My.Future\n",
"texto que sale : 14\n",
"texto que sale : 7\n",
"texto que sale : Up.My.Future\n",
"texto que sale : -1\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **LSTRIP**"
],
"metadata": {
"id": "4TIbr7Reklt6"
}
},
{
"cell_type": "code",
"source": [
"print(espacios_izquierda,\"-->\", len(espacios_izquierda))\n",
"print(espacios_izquierda.lstrip(),\"-->\", len(espacios_izquierda.lstrip()))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "_60SaGYdoosq",
"outputId": "955cbcdf-b440-41e6-cb9a-71f76f989dc3"
},
"execution_count": 50,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
" hola espacios izquierdos --> 33\n",
"hola espacios izquierdos --> 24\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **RSTRIP**"
],
"metadata": {
"id": "BFj3yYVqk3Ed"
}
},
{
"cell_type": "code",
"source": [
"print(espacios_derecha,\"-->\", len(espacios_derecha))\n",
"print(espacios_derecha.rstrip(),\"-->\", len(espacios_derecha.rstrip()))\n",
"# pepito@email.com"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "J8H855napLgs",
"outputId": "466d0797-d3dc-4c3e-f655-c987d97b518f"
},
"execution_count": 51,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"hola espacios derechos --> 34\n",
"hola espacios derechos --> 22\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **STRIP**\n",
"\n",
"Es el más utilizado"
],
"metadata": {
"id": "VJZlSIEik85v"
}
},
{
"cell_type": "code",
"source": [
"print(espacios_ambos,\"-->\", len(espacios_ambos))\n",
"print(espacios_ambos.strip(),\"-->\", len(espacios_ambos.strip()))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "VNzbCT8Tk8Ok",
"outputId": "37faa6db-56cd-415e-816f-86b3194d1ab6"
},
"execution_count": 52,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
" espacio central --> 35\n",
"espacio central --> 15\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"espacios_izquierda = ' hola espacios izquierdos'\n",
"espacios_derecha = 'hola espacios derechos '\n",
"espacios_ambos =' espacio central '"
],
"metadata": {
"id": "x2WLYXgqomvC"
},
"execution_count": 53,
"outputs": []
},
{
"cell_type": "code",
"source": [
"print(espacios_ambos.rstrip().lstrip()) # == espacios_ambos.strip()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "VWQZqrgcp58P",
"outputId": "8b56c8fa-6125-42d1-c26e-6ffde2bdac01"
},
"execution_count": 54,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"espacio central\n"
]
}
]
},
{
"cell_type": "code",
"source": [],
"metadata": {
"id": "k0wYqsUKqRwP"
},
"execution_count": 54,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"### **INDEX**"
],
"metadata": {
"id": "sj9ZmHeEtDBp"
}
},
{
"cell_type": "code",
"source": [
"print(\"texto que entra: \",curso)\n",
"print(\"texto que sale : \",curso.index(\"u\"))\n",
"print(\"texto que sale : \",curso.lower().index(\"u\"))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "H5gizQN0rPls",
"outputId": "7a6716f5-9ccf-403c-e1a6-706a3371e94d"
},
"execution_count": 55,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"texto que entra: CoDinG.Up.My.Future\n",
"texto que sale : 14\n",
"texto que sale : 7\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(\"texto que sale : \",curso.lower().index(\"X\"))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 176
},
"id": "i348QD-dtJDi",
"outputId": "c8db7fb9-6e99-4deb-9c6b-2f871f302a1b"
},
"execution_count": 56,
"outputs": [
{
"output_type": "error",
"ename": "ValueError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-56-879bdc54f344>\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"texto que sale : \"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mcurso\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlower\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"X\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mValueError\u001b[0m: substring not found"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **SPLIT**"
],
"metadata": {
"id": "oqRFSALfuUDM"
}
},
{
"cell_type": "code",
"source": [
"texto_multi_linea:str = \"\"\"\n",
"hola\n",
"como\n",
"están\n",
"1 2\n",
"\"\"\"\n",
"print(texto_multi_linea)\n",
"print(curso)\n",
"print(\"hola a todos\")\n",
"print(\"1111;NOMBRE;pepito@gmail.com\")"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "2wImkV3huTLR",
"outputId": "13d92a43-64ea-40d4-a668-77befb8c0a15"
},
"execution_count": 57,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"\n",
"hola\n",
"como\n",
"están\n",
"1 2\n",
"\n",
"CoDinG.Up.My.Future\n",
"hola a todos\n",
"1111;NOMBRE;pepito@gmail.com\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(\"tipo de dato :\",type(curso),len(curso),\"valor:\",curso)\n",
"datos_partidos = curso.split(\".\")\n",
"print(\"tipo de dato :\",type(datos_partidos),len(datos_partidos), datos_partidos,\"valor:\",curso)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "n7622SOcvbcH",
"outputId": "28598510-e3d1-4c87-9e73-df4c961957a4"
},
"execution_count": 58,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"tipo de dato : <class 'str'> 19 valor: CoDinG.Up.My.Future\n",
"tipo de dato : <class 'list'> 4 ['CoDinG', 'Up', 'My', 'Future'] valor: CoDinG.Up.My.Future\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(\"hola a todos\".split()) # simple\n",
"print(\"hola a todos\".split(\" \")) # simple\n",
"print(\"hola a todos\".split(\" \")) # espacio doble\n",
"print(texto_multi_linea.split(\"\\n\")) # salto linea | enter"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "951Ic1jOxATD",
"outputId": "db959f3a-4289-4291-eb2d-99f702260e9d"
},
"execution_count": 59,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"['hola', 'a', 'todos']\n",
"['hola', 'a', '', 'todos']\n",
"['hola a', 'todos']\n",
"['', 'hola', 'como', 'están', '1 2', '']\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(datos_partidos)\n",
"print(datos_partidos[::-1])"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "qGyGoHNTx5wg",
"outputId": "20e4f3bc-73ca-4bdb-fd49-5247928789e4"
},
"execution_count": 60,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"['CoDinG', 'Up', 'My', 'Future']\n",
"['Future', 'My', 'Up', 'CoDinG']\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **IS...**\n",
"\n",
"\n",
"\n",
"`variable.ISALGO` --> Validando lógica booleana `True o False`\n",
"\n"
],
"metadata": {
"id": "mcqi-Q_ZyWQB"
}
},
{
"cell_type": "code",
"source": [
"print(curso)\n",
"print(curso.islower())\n",
"print(curso.lower().islower())\n",
"print(curso.islower())\n",
"print(curso.isdigit())\n",
"print(\"122\".isdigit())"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "ElaysR32ypV0",
"outputId": "d02432c9-9ca5-4ccb-ab28-beba328e0608"
},
"execution_count": 61,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CoDinG.Up.My.Future\n",
"False\n",
"True\n",
"False\n",
"False\n",
"True\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"print(\"aa1\".isdigit())\n",
"int(\"aa1\")"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 211
},
"id": "prIH_ElY3fst",
"outputId": "dfd7f802-d90e-4205-aeb6-aace2fe04eb9"
},
"execution_count": 62,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"False\n"
]
},
{
"output_type": "error",
"ename": "ValueError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-62-7304cd3df8a7>\u001b[0m in \u001b[0;36m<cell line: 2>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"aa1\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0misdigit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"aa1\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mValueError\u001b[0m: invalid literal for int() with base 10: 'aa1'"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **MULTIPLICACIÓN**\n",
"\n",
"Las listas son diferentes de los arrays en python\n",
"\n",
"clave: arrays son para temas matemáticos"
],
"metadata": {
"id": "HlbdWeu50IWw"
}
},
{
"cell_type": "code",
"source": [
"print(\"@\" * 20)\n",
"print([1,\"ss\", 1.1] * 20)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "yBSz23ce0Hrd",
"outputId": "978f22c1-1a41-4ffb-e753-9b460d7bac01"
},
"execution_count": 63,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"@@@@@@@@@@@@@@@@@@@@\n",
"[1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1, 1, 'ss', 1.1]\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# ejemplo de array, no aprender por el momento\n",
"import numpy as np\n",
"arr = np.array([1, 2, 3, 4, 5])\n",
"print(arr, type(arr))\n",
"print(arr * 20)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "ASoYoVte0GtP",
"outputId": "4f4408d5-6070-498b-fb9b-a544385f4199"
},
"execution_count": 64,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1 2 3 4 5] <class 'numpy.ndarray'>\n",
"[ 20 40 60 80 100]\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"### **CONCATENACIÓN SIMPLE - MODO NOVATO**\n",
"\n",
"Cuando vamos a unir el valor de dos o más variables en una sola\n",
"\n",
"\n",
"valor esperado:\n",
"\n",
"\n",
"\n",
"```\n",
"el nombre es: nombre, apellido es: apellido, y la edad es: edad\n",
"```\n",
"\n",
"\n",
"```\n",
"se realiza con +\n",
"```\n",
"\n",
"restricción: de este modo, todas las variables deben ser del mismo tipo de dato\n",
"\n"
],
"metadata": {
"id": "ugppuhnW1Jqm"
}
},
{
"cell_type": "code",
"source": [
"nombre: str = \"pepito\"\n",
"apellido: str = \"perez\"\n",
"edad:int = 21"
],
"metadata": {
"id": "gHzYmy9W1JIf"
},
"execution_count": 65,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# fase 1\n",
"valor_esperado: str = \"el nombre es: \" + nombre\n",
"print(valor_esperado)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "owpapoPK14Gq",
"outputId": "37c77dd8-edc1-4517-f2d5-531ce8819baa"
},
"execution_count": 66,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"el nombre es: pepito\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# fase 2\n",
"valor_esperado: str = \"el nombre es: \" + nombre + \", apellido es: \" + apellido + \", y la edad es: \" + str(edad)\n",
"print(valor_esperado)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "foeAolv02D4q",
"outputId": "61ce650b-44e2-4ab9-e0c9-826e58b3c138"
},
"execution_count": 67,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"el nombre es: pepito, apellido es: perez, y la edad es: 21\n"
]
}
]
}
]
}
================================================
FILE: contenido.curso/003.recursos/LVL-1/LVL1.05.listas.tuplas.2.ipynb
================================================
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "qNgykDMA5hee"
},
"source": [
"<p><img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"\" width=\"1280\" height=\"300\" /></p>"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "x3xS7_CG66Ie"
},
"source": [
"# **LISTAS Y TUPLAS**"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "kfjmD7cy69JB"
},
"source": [
"## **LISTAS**\n",
"\n",
"Las listas son una estructura de datos fundamental en Python. Se utiliza para almacenar una colección ordenada de elementos. Estos elementos pueden ser de cualquier tipo, como números, cadenas de texto, objetos, u otras listas. Las listas son muy flexibles y versátiles, y se utilizan comúnmente para almacenar datos relacionados.\n",
"\n",
"<img src=\"https://controlautomaticoeducacion.com/wp-content/uploads/Objetos-en-una-lista-en-python-768x233.png\"\n",
" width=\"350\"\n",
" height=\"150\" class=\"center\"/>\n",
"\n",
"\n",
"Para un mejor entendimiento, veámoslo de otra manera usando Excel.\n",
"\n",
"\n",
"\n",
"```python\n",
"objetivo: str = \"ENSEÑANZA\"\n",
"lista: list = [1, 1.1, 'hola', True, False, [1,2,3], {1,2,3}, {1:1}, (1,2,3)]\n",
"```\n",
"\n",
"\n",
"\n",
"<img src=\"https://i.postimg.cc/ZKbk0XfX/listeasyv2.png\"\n",
" width=\"250\"\n",
" height=\"250\" class=\"center\"/>\n",
"\n",
" \n",
"\n",
"\n",
"**Consideraciones**\n",
"\n",
"\n",
"\n",
"1. Permiten almacenar cualquier tipo de valor como enteros, cadenas y hasta otras funciones\n",
"2. Son mutables\n",
"3. Los slices vistos en strings funcionan exactamente igual en las listas"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"id": "y6BvA3645g_0"
},
"outputs": [],
"source": [
"lista_vacia = []\n",
"lista_numeros = [1, 2, 3, 4 ,5 ,6]\n",
"lista_letras = [\"a\", \"b\", \"c\"]\n",
"lista_mix = [1, True, 3.5, [1,2], str.upper, (1,2), \"hola!\"]"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "ivut_eCd7wHD",
"outputId": "c4d97412-d1e7-4458-d24a-5668406ddc30"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"ESTAMOS APRENDIENDO\n"
]
}
],
"source": [
"print(lista_mix[4](\"estamos aprendiendo\"))"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "OYj3AorH7wEX",
"outputId": "a4a17955-02cc-4c7a-ff96-e0890202be23"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"larga : 2\n",
"corta : 2\n",
"corta : [2, 1]\n"
]
}
],
"source": [
"obtengo_lista: list = lista_mix[3]\n",
"print(\"larga : \", obtengo_lista[1])\n",
"print(\"corta : \", lista_mix[3][1])\n",
"print(\"corta : \", lista_mix[3][::-1])"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "I8RLrHhF7wBv",
"outputId": "70a7e5cc-f66e-4f5f-8f9f-3d52680fbb97"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"17.5\n",
"hola!hola!hola!hola!hola!\n"
]
}
],
"source": [
"print(lista_mix[2] * 5)\n",
"print(lista_mix[-1] * 5)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "xCl8lxyL7v_V",
"outputId": "5761ffe8-fa4c-4080-9b76-e9eac76fe431"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"paso # 1: [[5, 6, [7, 8]], 3, 4]\n",
"paso # 2: [5, 6, [7, 8]]\n",
"paso # 3: [7, 8]\n",
"paso # 4: 8\n"
]
}
],
"source": [
"# que lo hagan de la manera larga, definiendo variables\n",
"valor = [1, 2, [[5,6, [7,8]],3,4 ]]\n",
"print(\"paso # 1: \", valor[2])\n",
"print(\"paso # 2: \", valor[2][0])\n",
"print(\"paso # 3: \", valor[2][0][2])\n",
"print(\"paso # 4: \", valor[2][0][2][1])"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 245
},
"id": "KcCtNwlqnwSx",
"outputId": "0fe61408-a2d6-4472-f0f0-2ed01333eaa6"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1, 2, [[5, 6, [7, 8]], 3, 4]]\n"
]
},
{
"output_type": "error",
"ename": "TypeError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-7-3a6df301109e>\u001b[0m in \u001b[0;36m<cell line: 3>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# no soporta cuando hay listas embebidas\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvalor\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mvalor\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msort\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 4\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mvalor\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mTypeError\u001b[0m: '<' not supported between instances of 'list' and 'int'"
]
}
],
"source": [
"# no soporta cuando hay listas embebidas\n",
"print(valor)\n",
"valor.sort()\n",
"print(valor)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "fQq7UTvScshD"
},
"source": [
"### **APPEND**\n",
"\n",
"Siempre inserta en la última posición"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "q6yoYIU_dO6B",
"outputId": "c1055585-a368-40c6-bba0-3204fa72f836"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"pepito\n",
"PEPITO\n"
]
}
],
"source": [
"nombre = \"pepito\"\n",
"nombre.upper()\n",
"print(nombre)\n",
"nombre = nombre.upper()\n",
"print(nombre)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "pBvkpF4Qc0m-",
"outputId": "6df07e7c-2821-4d35-90f2-110edae786e3"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1]\n"
]
}
],
"source": [
"# inplace\n",
"lista_vacia.append(1)\n",
"print(lista_vacia)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Xo0cgPUpdvR4",
"outputId": "5dfb0ae5-af3f-4753-aaf1-01cf314f8104"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1, 7]\n"
]
}
],
"source": [
"lista_vacia.append(7)\n",
"print(lista_vacia)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "7ac3X9FiowOv",
"outputId": "4f96e996-19c6-4a00-f0b4-81fe1177b1d9"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1, 2, 3, [4, 5, 6]]\n"
]
}
],
"source": [
"pregunta = [1,2,3]\n",
"pregunta.append([4,5,6])\n",
"print(pregunta)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "zbTn9op7d3aw"
},
"source": [
"### **INSERT**\n",
"\n",
"(índice, elemento a adicionar)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "-8RHD3p9eHlA",
"outputId": "cf113b3b-80d5-4142-b3bf-7976c951081f"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[10, 1, 7]\n"
]
}
],
"source": [
"lista_vacia.insert(0, 10)\n",
"print(lista_vacia)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "uNdQW8u_ea5z",
"outputId": "11cfedad-ff55-4726-8d80-8a78b4a04037"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[10, 1, 7, 69]\n"
]
}
],
"source": [
"lista_vacia.insert(20, 69)\n",
"print(lista_vacia)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "unND9avTeqQZ",
"outputId": "dd15a143-a84b-4b38-aeea-aecafb8b3cd6"
},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"69"
]
},
"metadata": {},
"execution_count": 14
}
],
"source": [
"lista_vacia[3]"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "h9A29KawpEq9",
"outputId": "b51d2636-d77f-4689-aaed-66151a029d89"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1, 2, 69, 3]\n"
]
}
],
"source": [
"pregunta_fredy = [1,2,3]\n",
"pregunta_fredy.insert(-1, 69) # en esta forma en particular \"negativamente\" sí respeta el 0 | slices pero positivos\n",
"print(pregunta_fredy)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "rPvlD6pOe8qH"
},
"source": [
"### **REMOVE**"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "bBnmZ5tze5f_",
"outputId": "b8a44a5b-6f03-4a29-dbc6-39ad6dd02350"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[10, 1, 7, 69, 7]\n"
]
}
],
"source": [
"lista_vacia.append(7)\n",
"print(lista_vacia)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "LqD3O8QgfIzj",
"outputId": "ebaf733f-bc81-45b7-aa79-c3f7482d4d67"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[10, 1, 69, 7]\n"
]
}
],
"source": [
"lista_vacia.remove(7)\n",
"print(lista_vacia)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 193
},
"id": "aHrkAHOVfXsm",
"outputId": "1f2cb111-93e0-45e9-e4b6-c72432c2fbc0"
},
"outputs": [
{
"output_type": "error",
"ename": "ValueError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-19-94579878f98c>\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mlista_vacia\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mremove\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m17\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlista_vacia\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mValueError\u001b[0m: list.remove(x): x not in list"
]
}
],
"source": [
"lista_vacia.remove(17)\n",
"print(lista_vacia)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "6JNjwyz1fhy_"
},
"source": [
"### **POP**\n",
"FIFO Y LIFO: investigar\n",
"\n",
"\n",
"```\n",
"lista.pop([opcional index])\n",
"sin índice, elimina el último\n",
"con índice, elimina la posición designada\n",
"```\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "jeF3lJ91fhcx",
"outputId": "66e26e24-f99a-4d80-bc1b-cd39d343a449"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[10, 1, 69, 7]\n",
"[10, 1, 69]\n"
]
}
],
"source": [
"print(lista_vacia)\n",
"lista_vacia.pop()\n",
"print(lista_vacia)"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "SromUMWYgF2G",
"outputId": "2c30f9c8-694f-45cf-a322-902d4e5dc87e"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[10, 1, 69]\n",
"[1, 69]\n",
"El elemento eliminado es: 10\n"
]
}
],
"source": [
"print(lista_vacia)\n",
"valor_eliminado = lista_vacia.pop(0)\n",
"print(lista_vacia)\n",
"print(\"El elemento eliminado es:\", valor_eliminado)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "-va3V3fXgr0Z"
},
"source": [
"### **INDEX**\n",
"\n",
"Busca el índice donde está el valor\n",
"\n",
"Nota: el parámetro que se envía es el valor\n"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "O5Tbbjj0gweQ",
"outputId": "df1462ff-2548-4e8b-a61c-ff94630e2bcf"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1, 69, 3, 7]\n",
"2\n"
]
}
],
"source": [
"lista_vacia.append(3)\n",
"lista_vacia.append(7)\n",
"print(lista_vacia)\n",
"print(lista_vacia.index(3))"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "nq5pFetkhP3F",
"outputId": "6335af26-ba3c-4bb0-8aa6-e57e78f776ee"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1, 69, 3, 7]\n"
]
}
],
"source": [
"print(lista_vacia)"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "UKzPJEJWhM5L",
"outputId": "5ef3944d-9f84-40e7-86cd-9a2f73dfe3d8"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"2\n"
]
}
],
"source": [
"lista_vacia.append(3)\n",
"print(lista_vacia.index(3))"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 176
},
"id": "mIIOIL_FhIMS",
"outputId": "58ccdf3a-9db4-4def-ef77-146e2ebb4f0e"
},
"outputs": [
{
"output_type": "error",
"ename": "ValueError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-25-e2d31825bd16>\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlista_vacia\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m322\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mValueError\u001b[0m: 322 is not in list"
]
}
],
"source": [
"print(lista_vacia.index(322))"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "iqgAvTAYhUou"
},
"source": [
"### **COUNT**\n"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "cFnGnWFLhYvO",
"outputId": "46799a58-cb6f-4a6c-dcee-fb079d03f81d"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1, 69, 3, 7, 3]\n",
"2\n"
]
}
],
"source": [
"print(lista_vacia)\n",
"print(lista_vacia.count(3))"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "2rS0QA5lhg62",
"outputId": "e5d8980f-f2a6-4647-d6f6-c6152b2aa120"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1, 69, 3, 7, 3, 'python1']\n",
"1\n"
]
}
],
"source": [
"lista_vacia.append(\"python1\")\n",
"print(lista_vacia)\n",
"print(lista_vacia.count(\"python1\"))"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "mJgz3m2mhUmZ"
},
"source": [
"### **SORT**"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "mYeDqAU_hvm7",
"outputId": "ebe7b8a3-abdf-49c3-c77e-c9704102780c"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[3, 1, 2]\n",
"[1, 2, 3]\n"
]
}
],
"source": [
"resultado = [3, 1, 2]\n",
"print(resultado)\n",
"resultado.sort()\n",
"print(resultado)"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "jw0jMKx3iDLU",
"outputId": "ee54d360-cf63-4014-f201-1b663a9b856e"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[3, 1, 2]\n",
"[3, 2, 1]\n"
]
}
],
"source": [
"resultado = [3, 1, 2]\n",
"print(resultado)\n",
"resultado.sort(reverse=True)\n",
"print(resultado)"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Usv6NA25iKEE",
"outputId": "acee6c6a-4a60-46b4-b90f-5b9cb1a04ea3"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[3, 2, 1]\n"
]
}
],
"source": [
"resultado = [3, 1, 2]\n",
"resultado.sort()\n",
"print(resultado[::-1])"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "9K20GV55ide2"
},
"source": [
"### **REVERSE**"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "jU7C3dMkigGe",
"outputId": "fb7b6b97-d819-4756-d800-d5908e958204"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1, 69, 3, 7, 3, 'python1']\n",
"['python1', 3, 7, 3, 69, 1]\n"
]
}
],
"source": [
"print(lista_vacia)\n",
"lista_vacia.reverse()\n",
"print(lista_vacia)"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "qOVH9-MSipak",
"outputId": "19082785-a37f-41a1-d770-a32d1dbb90fc"
},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"[1, 69, 3, 7, 3, 'python1']"
]
},
"metadata": {},
"execution_count": 32
}
],
"source": [
"lista_vacia[::-1]"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "X2Y8XGavi4d6"
},
"source": [
"### **CLEAR**"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "67D1CPagi73y",
"outputId": "b70c4de2-546b-4ece-8ebf-f20845830c49"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[3, 1, 2]\n",
"[]\n"
]
}
],
"source": [
"resultado = [3, 1, 2]\n",
"print(resultado)\n",
"resultado.clear()\n",
"print(resultado)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "SyxEKvmOjsBb"
},
"source": [
"### **COPY**\n"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "mUQr3C4CjwXQ",
"outputId": "b5498e04-09b7-4e1d-a041-b8e57d15477c"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1, 2, 3, 4, 5, 6]\n",
"['a', 'b', 'c']\n"
]
}
],
"source": [
"# cs_lista_numeros = lista_numeros\n",
"cs_lista_numeros = lista_numeros.copy() # esta es la recomendada\n",
"cs_lista_letras = lista_letras.copy()\n",
"print(cs_lista_numeros)\n",
"print(cs_lista_letras)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "UxJRM9-7jPNM"
},
"source": [
"### **EXTEND**\n",
"\n",
"Sirve para concatenar listas"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "EhowhTL0jOlG",
"outputId": "70409341-cdfe-4c30-cb19-72e00c3418ab"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1, 2, 3, 4, 5, 6]\n",
"['a', 'b', 'c']\n"
]
}
],
"source": [
"print(lista_numeros)\n",
"print(lista_letras)"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "gZThXiZLjNpf",
"outputId": "ae7b06c9-5f89-475e-de5a-83cb69e69fcf"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[1, 2, 3, 4, 5, 6]\n",
"[1, 2, 3, 4, 5, 6, 'a', 'b', 'c']\n"
]
}
],
"source": [
"print(lista_numeros)\n",
"lista_numeros.extend(lista_letras)\n",
"print(lista_numeros)"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "fooupjMckXP8",
"outputId": "9a51d5a2-45fa-48ed-bc9a-16d29e3e45d9"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"['a', 'b', 'c']\n",
"['a', 'b', 'c', 1, 2, 3, 4, 5, 6]\n"
]
}
],
"source": [
"# Es lo mismo\n",
"print(cs_lista_letras)\n",
"cs_lista_letras += cs_lista_numeros\n",
"print(cs_lista_letras)"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "aCt646gokoRo",
"outputId": "7e380510-af8f-4988-e123-1e515f776743"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"['python1', 3, 7, 3, 69, 1]\n",
"['python1', 3, 7, 3, 69, 1, 'c', 'o', 'd', 'i', 'n', 'g', '.', 'u', 'p', '.', 'm', 'y', 'f', 'u', 't', 'u', 'r', 'e']\n"
]
}
],
"source": [
"# coding.up.myfuture\n",
"print(lista_vacia)\n",
"lista_vacia.extend(\"coding.up.myfuture\")\n",
"print(lista_vacia)"
]
},
{
"cell_type": "code",
"execution_count": 39,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "S2NoLwrnlMDV",
"outputId": "dd9da303-f743-4fbb-b462-d0587f57b566"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"['python1', 3, 7, 3, 69, 1, 'c', 'o', 'd', 'i', 'n', 'g', '.', 'u', 'p', '.', 'm', 'y', 'f', 'u', 't', 'u', 'r', 'e']\n",
"['python1', 3, 7, 3, 69, 1, 'c', 'o', 'd', 'i', 'n', 'g', '.', 'u', 'p', '.', 'm', 'y', 'f', 'u', 't', 'u', 'r', 'e', 'coding', 'up', 'myfuture']\n"
]
}
],
"source": [
"print(lista_vacia)\n",
"lista_vacia.extend(\"coding.up.myfuture\".split(\".\"))\n",
"print(lista_vacia)"
]
},
{
"cell_type": "code",
"execution_count": 40,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "_RK6HcKVlvDr",
"outputId": "38627e52-bbb3-4352-db6b-605df337d202"
},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"['coding', 'up', 'myfuture']"
]
},
"metadata": {},
"execution_count": 40
}
],
"source": [
"\"coding.up.myfuture\".split(\".\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Z-lTsmzomCtK"
},
"source": [
"### **MODIFICANDO VALOR POR ÍNDICE**"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "HgS4DHH0mZoX"
},
"source": [
"#### **UN VALOR SOLITO**"
]
},
{
"cell_type": "code",
"execution_count": 41,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "90J_gC-Nl-1x",
"outputId": "c33eff96-484a-4256-e1d1-42e08f752430"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"['python1', 3, 7, 3, 69, 1, 'c', 'o', 'd', 'i', 'n', 'g', '.', 'u', 'p', '.', 'm', 'y', 'f', 'u', 't', 'u', 'r', 'e', 'coding', 'up', 'myfuture']\n",
"['zero to hero', 3, 7, 3, 69, 1, 'c', 'o', 'd', 'i', 'n', 'g', '.', 'u', 'p', '.', 'm', 'y', 'f', 'u', 't', 'u', 'r', 'e', 'coding', 'up', 'myfuture']\n"
]
}
],
"source": [
"print(lista_vacia)\n",
"lista_vacia[0] = \"zero to hero\"\n",
"print(lista_vacia)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "C2sZWwW-mctx"
},
"source": [
"#### **MODIFICAR RANGO**"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "MbxMEORKmQHn",
"outputId": "dc1454f3-293c-4cd2-ce30-48d783499949"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"['zero to hero', 3, 7, 3, 69, 1, 'c', 'o', 'd', 'i', 'n', 'g', '.', 'u', 'p', '.', 'm', 'y', 'f', 'u', 't', 'u', 'r', 'e', 'coding', 'up', 'myfuture']\n",
"['zero to hero', 3, 1, 1, 1, 1, 'c', 'o', 'd', 'i', 'n', 'g', '.', 'u', 'p', '.', 'm', 'y', 'f', 'u', 't', 'u', 'r', 'e', 'coding', 'up', 'myfuture']\n"
]
}
],
"source": [
"print(lista_vacia)\n",
"lista_vacia[2:5] = [1,1,1]\n",
"print(lista_vacia)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "TVGMGHxgk9Vy"
},
"source": [
"### **MAPEO O DESACOPLAMIENTO DE VALORES**\n",
"\n",
"Trucos:\n",
"\n",
"1. **TOTAL**: igual número de elementos de la lista, igual número de variables\n",
"2. **PARCIAL**: solo toma una parte en variables, y la última toma todo\n",
"**NOTA: NO EXCEDERSE**\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "9xaLQt4llIgs",
"outputId": "e53808dd-37b7-4fd4-bbab-3871c9433b0d"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"['coding', 'up', 'my', 'future']\n"
]
}
],
"source": [
"datos:list = \"coding.up.my.future\".split(\".\")\n",
"print(datos)"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "iXoU7tsilsti",
"outputId": "56ad292a-6ca1-4685-d69e-2721f64a1fc9"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"coding -- up -- my -- future\n"
]
}
],
"source": [
"variable1 = datos[0]\n",
"variable2 = datos[1]\n",
"variable3 = datos[2]\n",
"variable4 = datos[3]\n",
"print(variable1,variable2,variable3,variable4, sep=\" -- \")"
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "-z4eDR3lmNhy",
"outputId": "d21bc101-c30f-42a3-b7e5-a52b5f436a18"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"['c@ding', 'up', 'my', 'future']\n",
"c@ding -- up -- my -- future\n"
]
}
],
"source": [
"datos:list = \"c@ding.up.my.future\".split(\".\")\n",
"# ['c@ding', 'up', 'my', 'future']\n",
"# var1. var2 var3 var4\n",
"print(datos)\n",
"variable1, variable2, variable3, variable4 = datos\n",
"print(variable1,variable2,variable3,variable4, sep=\" -- \")"
]
},
{
"cell_type": "code",
"execution_count": 46,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "5rfjE7ikm65l",
"outputId": "5276c3f8-4633-428c-9b8d-ca0435e0f93b"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"c@ding\n",
"['up', 'my', 'future']\n"
]
}
],
"source": [
"# primera parte\n",
"\n",
"que_hacemos, *el_resto = datos\n",
"print(que_hacemos)\n",
"print(el_resto)"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "I40EF2QjnuFk",
"outputId": "984400f7-3911-4669-8256-35bbb3bef804"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"['c@ding', 'up', 'my', 'future']\n",
"variables c@ding up\n",
"['my', 'future']\n"
]
}
],
"source": [
"# primera parte\n",
"print(datos)\n",
"que_hacemos_1,que_hacemos_2, *el_resto = datos\n",
"print(\"variables\",que_hacemos_1,que_hacemos_2)\n",
"print(el_resto)"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 176
},
"id": "yKiqKfOXoSst",
"outputId": "2a0b66be-3ed5-4f56-881f-d71579693d1f"
},
"outputs": [
{
"output_type": "error",
"ename": "ValueError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-48-c641f1820eec>\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mvariable1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvariable2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvariable3\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvariable4\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvariable5\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdatos\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mValueError\u001b[0m: not enough values to unpack (expected 5, got 4)"
]
}
],
"source": [
"variable1, variable2, variable3, variable4, variable5 = datos"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 176
},
"id": "dtOMyLzLoWZm",
"outputId": "6acd3756-ff8a-4928-b44d-958e94bba29c"
},
"outputs": [
{
"output_type": "error",
"ename": "ValueError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-49-fd5918970b25>\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mvariable1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvariable2\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvariable3\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdatos\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mValueError\u001b[0m: too many values to unpack (expected 3)"
]
}
],
"source": [
"variable1, variable2, variable3 = datos"
]
},
{
"cell_type": "code",
"execution_count": 50,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "0fbxA7KDoeY9",
"outputId": "476714d9-206f-4fe4-823f-240d7b61320f"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"c@ding\n",
"['up', 'my', 'future']\n"
]
}
],
"source": [
"# truco\n",
"que_hacemos, *_ = datos\n",
"print(que_hacemos)\n",
"print(_)"
]
},
{
"cell_type": "code",
"execution_count": 51,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "8lg6RIFHozgC",
"outputId": "827c6610-03d9-4d16-922b-78f8348ee327"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"W\n"
]
}
],
"source": [
"a,b,c,d = \"WXYZ\"\n",
"print(a)"
]
},
{
"cell_type": "code",
"execution_count": 52,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "1VOYn3CUo-UJ",
"outputId": "2958a7d9-3c54-4e7a-b6ec-589a95889b3e"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"W\n",
"['X', 'Y', 'Z']\n"
]
}
],
"source": [
"a,*el_nombre_que_quieran = \"WXYZ\"\n",
"print(a)\n",
"print(el_nombre_que_quieran)"
]
},
{
"cell_type": "code",
"execution_count": 53,
"metadata": {
"id": "cvhHDtKtszZF"
},
"outputs": [],
"source": [
"# truco con asignación variables | con listas ok, pero con variables y valores es mala practica\n",
"a,b,c,d = True, True,1,2\n"
]
},
{
"cell_type": "code",
"execution_count": 55,
"metadata": {
"id": "TC4jeO_KtlaF"
},
"outputs": [],
"source": [
"a,*c,n = \"ABCDW\""
]
},
{
"cell_type": "code",
"execution_count": 54,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 245
},
"id": "ZTl4VkDgtyrC",
"outputId": "d1d550ec-4efd-492b-c3f9-90b1c3ddd7a5"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"True\n",
"1\n"
]
},
{
"output_type": "error",
"ename": "NameError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-54-ba940f9741c7>\u001b[0m in \u001b[0;36m<cell line: 3>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mc\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mn\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mNameError\u001b[0m: name 'n' is not defined"
]
}
],
"source": [
"print(a)\n",
"print(c)\n",
"print(n)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "KDlUYlM-8e-a"
},
"source": [
"## **TUPLAS**\n",
"\n",
"\n",
"\n",
"1. Se acceden con slices\n",
"2. Son inmutables\n"
]
},
{
"cell_type": "code",
"execution_count": 56,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "V7hqUvcJpVyH",
"outputId": "dc3bf550-0662-4f8a-ba1d-90cf2fdbeba4"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"<class 'tuple'> (1, 2, 3)\n"
]
}
],
"source": [
"tupla: tuple = (1,2,3)\n",
"print(type(tupla), tupla)"
]
},
{
"cell_type": "code",
"execution_count": 59,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 176
},
"id": "3IvopQP2pvt9",
"outputId": "048ed792-eddc-4dae-d051-47ea5abea9d2"
},
"outputs": [
{
"output_type": "error",
"ename": "TypeError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-59-ef583f1eb560>\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mtupla\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m999\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m: 'tuple' object does not support item assignment"
]
}
],
"source": [
"tupla[0] = 999"
]
},
{
"cell_type": "code",
"execution_count": 58,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "DPHRnypNp49n",
"outputId": "12df8291-e6b1-47f2-c83a-3b016630e5b3"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"(3, 2, 1)\n"
]
}
],
"source": [
"print(tupla[::-1])"
]
},
{
"cell_type": "code",
"execution_count": 62,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "nXiebdPYqAJO",
"outputId": "8d5067bc-b98e-4b8b-a9e6-c93f7345a96d"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"antes : <class 'list'> ['CC', 'TI', 'CE', 'PASP']\n",
"despues : <class 'tuple'> ('CC', 'TI', 'CE', 'PASP')\n"
]
}
],
"source": [
"tipo_documento: list = [\"CC\", \"TI\", \"CE\", \"PASP\"]\n",
"print(\"antes : \", type(tipo_documento), tipo_documento)\n",
"tipo_documento = tuple(tipo_documento)\n",
"print(\"despues : \", type(tipo_documento), tipo_documento)"
]
},
{
"cell_type": "code",
"execution_count": 61,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 176
},
"id": "llvNwrDYqjfa",
"outputId": "2e80c43c-47cb-4994-93d7-3aad325c5a9c"
},
"outputs": [
{
"output_type": "error",
"ename": "TypeError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-61-430c7ec3cfe4>\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mtipo_documento\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m\"X\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"Y\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m: 'tuple' object does not support item assignment"
]
}
],
"source": [
"tipo_documento[0:1] = [\"X\", \"Y\"]"
]
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
================================================
FILE: contenido.curso/003.recursos/LVL-1/LVL1.05.numeros.bool.1.ipynb
================================================
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"source": [
"<p><img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"\" width=\"1280\" height=\"300\" /></p>"
],
"metadata": {
"id": "tvMUG8pT5V-R"
}
},
{
"cell_type": "markdown",
"source": [
"# **NÚMEROS Y BOOLEANOS**"
],
"metadata": {
"id": "RueVSUHC5ykN"
}
},
{
"cell_type": "markdown",
"source": [
"## **NÚMEROS**"
],
"metadata": {
"id": "Y8MTfv2u53-z"
}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "X8DbcyPR5EMB"
},
"outputs": [],
"source": [
"valor1:int = 5\n",
"valor2:int = 2"
]
},
{
"cell_type": "code",
"source": [
"print(\"suma : \", valor1 + valor2)\n",
"print(\"resta : \", valor1 - valor2)\n",
"print(\"multiplicacion : \", valor1 * valor2)\n",
"print(\"division : \", valor1 / valor2)\n",
"print(\"operaciones : \", ((valor1 * valor2) + 555) / 35)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "m0Q5WjBo5qeb",
"outputId": "893e0d3f-ef53-4e82-c7d6-702c45433700"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"suma : 7\n",
"resta : 3\n",
"multiplicacion : 10\n",
"division : 2.5\n",
"operaciones : 16.142857142857142\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"resultado_suma = valor1 + valor2\n",
"print(type(resultado_suma), resultado_suma)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "xjv5cs0jQ-5R",
"outputId": "e424f0da-e181-4784-ee20-0bb3e177fd86"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"<class 'int'> 7\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"resultado_division = valor1 / valor2\n",
"print(type(resultado_division), resultado_division)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "fakQR-3ERLvh",
"outputId": "9343a267-66f2-44ba-bcc1-c146b64319ad"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"<class 'float'> 2.5\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# ejemplo grupal | tomar dos numeros y multiplicarlos\n",
"valor_ingresado_1: int = int(input(\"ingrese número 1: \"))\n",
"valor_ingresado_2: int = int(input(\"ingrese número 2: \"))\n",
"print(type(valor_ingresado_1), type(valor_ingresado_2))\n",
"resultado:int = valor_ingresado_1 * valor_ingresado_2\n",
"print(resultado)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "qDNSJlPYRZu0",
"outputId": "fc8aa327-3d0d-4d23-c407-4f500fc4d1ce"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"ingrese número 1: 5\n",
"ingrese número 2: 5\n",
"<class 'int'> <class 'int'>\n",
"25\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"\"*\" * 100"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 35
},
"id": "7sIa1QRfSavq",
"outputId": "b2d91793-07c7-4d55-c7aa-7e716b9dfc4a"
},
"execution_count": null,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'****************************************************************************************************'"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "string"
}
},
"metadata": {},
"execution_count": 8
}
]
},
{
"cell_type": "markdown",
"source": [
"## **BOOLEANOS**\n",
"\n",
"* `True = 1`\n",
"* `False = 0`\n",
"\n",
"Los boleanos en python tambien aplican como numeros, es decir se puede realizar\n",
"operaciones matemáticas"
],
"metadata": {
"id": "7Aieiytq59Ng"
}
},
{
"cell_type": "code",
"source": [
"es_verdadero:bool = True\n",
"es_falso = False"
],
"metadata": {
"id": "NAMGZy-76ag-"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"print(es_verdadero, es_falso, type(es_verdadero), type(es_falso))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "WT7-juSsTkLW",
"outputId": "c180304b-b263-404c-d869-4e689b74c286"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
gitextract_qcm5fu1p/
├── .github/
│ └── workflows/
│ ├── notify.yml
│ └── send_telegram_message.py
├── .gitignore
├── LICENSE
├── README.md
├── contenido.curso/
│ ├── 002.videos/
│ │ ├── 001.welcome27072023.txt
│ │ └── 002.preguntas.respuestas.taller.txt
│ └── 003.recursos/
│ ├── LVL-1/
│ │ ├── LVL1.01.intro.ipynb
│ │ ├── LVL1.02.variables.print.ipynb
│ │ ├── LVL1.03.str.1.ipynb
│ │ ├── LVL1.04.str.2.ipynb
│ │ ├── LVL1.05.listas.tuplas.2.ipynb
│ │ ├── LVL1.05.numeros.bool.1.ipynb
│ │ ├── LVL1.06.diccionarios.1.ipynb
│ │ ├── LVL1.07.diccionarios.2.ipynb
│ │ ├── LVL1.08.funciones.globales.ipynb
│ │ └── LVL1.08.sets.ipynb
│ ├── LVL-2/
│ │ ├── LVL2.01.operadores.metacon.ipynb
│ │ ├── LVL2.02.condicionales.ipynb
│ │ ├── LVL2.03.bucles.ipynb
│ │ ├── LVL2.04.bucles2.funciones.ipynb
│ │ ├── LVL2.05.funciones2.ipynb
│ │ ├── LVL2.06.funciones3.ipynb
│ │ ├── LVL2.07.format.ipynb
│ │ ├── LVL2.08.files1.ipynb
│ │ ├── LVL2.09.files2.ipynb
│ │ └── LVL2.10.fechas.ipynb
│ ├── LVL-3/
│ │ ├── LV3_05_06_poo_3_4/
│ │ │ ├── 001_validador_elementales.py
│ │ │ ├── 002_validar_documentacion.py
│ │ │ ├── 003_validar_estaticos.py
│ │ │ ├── 004_metodos_de_clase.py
│ │ │ ├── 005_get_set.py
│ │ │ ├── README.md
│ │ │ ├── decoradores_clases/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── decoradores.py
│ │ │ │ ├── estaticos.py
│ │ │ │ └── metodos_de_clase.py
│ │ │ ├── docs/
│ │ │ │ └── clase.docs.txt
│ │ │ ├── documentacion/
│ │ │ │ ├── __init__.py
│ │ │ │ └── docs.py
│ │ │ ├── documentacion.docs.html
│ │ │ └── operaciones_matematicas/
│ │ │ ├── __init__.py
│ │ │ ├── elementales.py
│ │ │ └── elementales_objetos.py
│ │ ├── LVL3.01.clases.ipynb
│ │ ├── LVL3.02.clases.metadata.ipynb
│ │ ├── LVL3.03.cuatro.pilares.poo.1.ipynb
│ │ ├── LVL3.04.cuatro.pilares.poo.2.ipynb
│ │ ├── LVL3_07_08_clases_especiales/
│ │ │ ├── 001.test_atributos.py
│ │ │ ├── 002.ms_rep.py
│ │ │ ├── 003.ms_str.py
│ │ │ ├── 004.ms_str_rep.py
│ │ │ ├── 005.at_doc.py
│ │ │ ├── 006.ms_call.py
│ │ │ ├── 007.ms_format.py
│ │ │ ├── README.md
│ │ │ ├── especiales/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── ae_doc.py
│ │ │ │ ├── me_call.py
│ │ │ │ ├── me_format.py
│ │ │ │ ├── me_repr.py
│ │ │ │ ├── me_repr_str.py
│ │ │ │ └── me_str.py
│ │ │ └── generico/
│ │ │ ├── __init__.py
│ │ │ ├── calculadora.py
│ │ │ ├── poo.py
│ │ │ └── procedural.py
│ │ ├── LVL3_09_excepciones/
│ │ │ ├── 000.excepciones.ipynb
│ │ │ ├── 001.elemental.py
│ │ │ ├── 002.conmassazon.py
│ │ │ ├── 003.excepcioncarinosa.py
│ │ │ ├── 004.otro_tipo_de_captura.py
│ │ │ ├── 005.assert.py
│ │ │ ├── README.md
│ │ │ └── excepciones/
│ │ │ ├── __init__.py
│ │ │ └── elemental.py
│ │ └── LVL3_10_programacion_funcional/
│ │ ├── README.md
│ │ ├── asserts/
│ │ │ ├── __init__.py
│ │ │ ├── complejo.py
│ │ │ ├── con_mensaje.py
│ │ │ ├── ok.py
│ │ │ └── sin_mensaje.py
│ │ └── programacion_funcional/
│ │ ├── filter.py
│ │ ├── map.py
│ │ └── reduce.py
│ ├── LVL-4/
│ │ ├── LVL4.01.estructuracion.proyecto/
│ │ │ ├── 001.video.sesion.txt
│ │ │ └── README.md
│ │ ├── LVL4.02.dependencias.ambientes.virtuales/
│ │ │ ├── 001.RUTAS.ENVARIABLES.md
│ │ │ ├── 002.LIBRERIAS.md
│ │ │ ├── 003.AMBIENTES.VIRTUALES.md
│ │ │ ├── README.md
│ │ │ ├── directorios.archivos.info/
│ │ │ │ └── os.sys.ipynb
│ │ │ ├── paquetes.info/
│ │ │ │ ├── demo.py
│ │ │ │ ├── libreriapropia.py
│ │ │ │ ├── sistema.py
│ │ │ │ └── truco.sh
│ │ │ └── sistema.info/
│ │ │ ├── envariables.libexterna.py
│ │ │ ├── envariables.manuales.py
│ │ │ └── sistema.py
│ │ ├── LVL4.03.creacion.proyecto/
│ │ │ ├── README.md
│ │ │ ├── bootcamp/
│ │ │ │ ├── README.md
│ │ │ │ ├── demo/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── config/
│ │ │ │ │ │ ├── files/
│ │ │ │ │ │ │ └── .gitkeep
│ │ │ │ │ │ ├── images/
│ │ │ │ │ │ │ └── .gitkeep
│ │ │ │ │ │ └── messages/
│ │ │ │ │ │ └── mensajes.json
│ │ │ │ │ └── utilities/
│ │ │ │ │ └── demo.py
│ │ │ │ ├── pyproject.toml
│ │ │ │ └── tests/
│ │ │ │ └── __init__.py
│ │ │ ├── paquetes.info/
│ │ │ │ ├── demo.py
│ │ │ │ └── truco.sh
│ │ │ ├── proyecto_igual/
│ │ │ │ ├── README.md
│ │ │ │ ├── proyecto_igual/
│ │ │ │ │ └── __init__.py
│ │ │ │ ├── pyproject.toml
│ │ │ │ └── tests/
│ │ │ │ └── __init__.py
│ │ │ ├── proyecto_manual/
│ │ │ │ ├── README.md
│ │ │ │ ├── librerias/
│ │ │ │ │ └── utilitarios/
│ │ │ │ │ └── __init__.py
│ │ │ │ └── requirements.txt
│ │ │ └── proyecto_noigual/
│ │ │ ├── README.md
│ │ │ ├── apibootcamp/
│ │ │ │ └── __init__.py
│ │ │ ├── pyproject.toml
│ │ │ └── tests/
│ │ │ └── __init__.py
│ │ ├── LVL4.04.buenas.practicas.1/
│ │ │ ├── 001.YAML.md
│ │ │ ├── 002.LOGGIN.md
│ │ │ ├── 003.TYPING.md
│ │ │ ├── 004.ENTRYPOINT.md
│ │ │ ├── 005.SYSARGS.md
│ │ │ ├── 006.ARGPARSE.md
│ │ │ ├── README.md
│ │ │ ├── config/
│ │ │ │ ├── mensajes.yaml
│ │ │ │ └── simple.yaml
│ │ │ ├── snipcode/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── argparse/
│ │ │ │ │ ├── 01_uso_parser_elemental.py
│ │ │ │ │ └── 02_uso_argarser_opciones.py
│ │ │ │ ├── loggin/
│ │ │ │ │ ├── simple.py
│ │ │ │ │ └── uso_loggin_avanzado.py
│ │ │ │ ├── main/
│ │ │ │ │ ├── para_proyecto.py
│ │ │ │ │ └── uso_main.py
│ │ │ │ ├── sysargs/
│ │ │ │ │ └── uso_sysargs.py
│ │ │ │ ├── typing/
│ │ │ │ │ └── uso_typing.py
│ │ │ │ └── yaml/
│ │ │ │ └── uso_yaml.py
│ │ │ ├── test_loggin.py
│ │ │ └── test_yaml.py
│ │ ├── LVL4.05.git.basico/
│ │ │ ├── 001.video.sesion.txt
│ │ │ ├── Dockerfile
│ │ │ └── README.md
│ │ ├── LVL4.06.07.buenas.practicas.2/
│ │ │ ├── FLAKE8.md
│ │ │ ├── PYTEST.md
│ │ │ ├── README.md
│ │ │ └── calidad/
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── borrar.py
│ │ │ ├── calidad/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── config/
│ │ │ │ │ └── files/
│ │ │ │ │ └── demo.yaml
│ │ │ │ ├── pruebas/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── linting.py
│ │ │ │ │ └── operaciones.py
│ │ │ │ └── utilitarios/
│ │ │ │ └── texto.py
│ │ │ ├── pyproject.toml
│ │ │ ├── setup.cfg
│ │ │ └── tests/
│ │ │ ├── __init__.py
│ │ │ ├── conftest.py
│ │ │ ├── pruebas/
│ │ │ │ ├── test_linting.py
│ │ │ │ └── test_operaciones.py
│ │ │ └── utilitarios/
│ │ │ └── test_texto.py
│ │ ├── LVL4.08.dataclases.pydantic/
│ │ │ ├── README.md
│ │ │ ├── dataclases.pydantic.ipynb
│ │ │ └── video.clase.txt
│ │ └── LVL4.09.expresiones.regulares/
│ │ └── LVL4.09.expresiones.regulares.ipynb
│ └── LVL-5/
│ ├── LVL5.01.intro.linux/
│ │ ├── linux.000.intro.ipynb
│ │ └── video.txt
│ ├── LVL5.02.intro.consola/
│ │ └── comandos.txt
│ ├── LVL5.03.intro.os/
│ │ ├── comandos.txt
│ │ ├── demo.py
│ │ ├── demo_error.py
│ │ ├── info_comandos.txt
│ │ ├── labp.txt
│ │ └── sesion_5.json
│ ├── LVL5.04.intro.os.dos/
│ │ └── seson_4.cast
│ ├── LVL5.05.vim.operadores/
│ │ ├── 001.vim.comandos.txt
│ │ ├── datasets/
│ │ │ ├── col.deptos.txt
│ │ │ ├── columnas.txt
│ │ │ ├── ips.txt
│ │ │ ├── logs.txt
│ │ │ └── nf.txt
│ │ └── s5.cast
│ ├── LVL5.06.programacion.1/
│ │ ├── archivos_eliminar.txt
│ │ ├── datasets/
│ │ │ ├── col.deptos.txt
│ │ │ ├── columnas.txt
│ │ │ ├── ips.txt
│ │ │ ├── logs.txt
│ │ │ └── nf.txt
│ │ ├── docs/
│ │ │ ├── formato.fecha.avanzado.txt
│ │ │ └── formato.fecha.elemental.txt
│ │ ├── s6.cast
│ │ └── variables.sh
│ ├── LVL5.07.programacion.2/
│ │ ├── 000.comentarios.sh
│ │ ├── 001.if.sh
│ │ ├── 002.for.sh
│ │ ├── 003.while.sh
│ │ ├── 004.parametros.shell.sh
│ │ ├── docs/
│ │ │ └── linux.006.basico.programacion.ipynb
│ │ ├── log.2
│ │ ├── log.txt
│ │ ├── programa.py
│ │ └── video/
│ │ └── link.txt
│ ├── LVL5.08.programacion.3/
│ │ ├── case.sh
│ │ ├── central.sh
│ │ ├── funciones.sh
│ │ ├── s8.cast
│ │ └── utilitarios/
│ │ └── genericos.sh
│ ├── LVL5.09.programacion.4/
│ │ ├── aplinux.sh
│ │ ├── apython.py
│ │ ├── case_final.sh
│ │ ├── conf.yaml
│ │ ├── consideraciones.txt
│ │ ├── entrada_consola.sh
│ │ ├── entrada_consola_avanzada.sh
│ │ └── s9.cast
│ ├── LVL5.10.practica.final/
│ │ ├── analisis/
│ │ │ └── requerimientos_tareas.txt
│ │ ├── app.sh
│ │ ├── componentes/
│ │ │ ├── get_header.py
│ │ │ └── utilities.sh
│ │ ├── ingredientes/
│ │ │ ├── escribir_ini.py
│ │ │ ├── leer_ini.py
│ │ │ └── parse_args.py
│ │ └── video/
│ │ └── video.txt
│ └── tutorial.asciinema/
│ ├── comandos.txt
│ └── video.txt
├── material.apoyo/
│ ├── complementos/
│ │ ├── pandas.ipynb
│ │ └── random.ipynb
│ ├── issues/
│ │ ├── 001.tutorial.github.issues.txt
│ │ └── pandas.ipynb
│ └── trabajo.final/
│ └── V1/
│ ├── Makefile
│ ├── README.md
│ ├── __init__.py
│ ├── __meta__.py
│ ├── apolo-11.py
│ ├── documentacion/
│ │ └── criterios.desarrollados/
│ │ └── 001.index.documentacion.xlsx
│ ├── nasa/
│ │ ├── __init__.py
│ │ ├── comunes/
│ │ │ ├── constantes.py
│ │ │ ├── decoradores.py
│ │ │ ├── excepcion.py
│ │ │ ├── inicializador.py
│ │ │ ├── parametros.py
│ │ │ └── utilitarios.py
│ │ ├── config/
│ │ │ ├── archivos/
│ │ │ │ ├── app.yaml
│ │ │ │ └── mensajes.yaml
│ │ │ ├── deltas/
│ │ │ │ └── generador
│ │ │ └── logotipos/
│ │ │ ├── nasa
│ │ │ └── softserve
│ │ ├── modelamiento/
│ │ │ ├── abstraccion/
│ │ │ │ ├── operaciones_os.py
│ │ │ │ └── reportes.py
│ │ │ ├── enumeradores/
│ │ │ │ └── reportes.py
│ │ │ ├── herencia/
│ │ │ │ └── acciones_os.py
│ │ │ ├── modelo/
│ │ │ │ └── archivos.py
│ │ │ └── propiedades/
│ │ │ └── instancias.py
│ │ └── negocio/
│ │ ├── generardor.py
│ │ └── reportes.py
│ ├── pyproject.toml
│ ├── setup.cfg
│ └── tests/
│ ├── __init__.py
│ ├── comunes/
│ │ ├── constantes.py
│ │ ├── decoradores.py
│ │ ├── excepciones.py
│ │ ├── inicializador.py
│ │ ├── parametros.py
│ │ ├── utilitarios_funcionalidades.py
│ │ └── utilitarios_struct.py
│ ├── conftest.py
│ ├── modelamiento/
│ │ ├── enumeradores.py
│ │ └── modelo.py
│ ├── nasa/
│ │ └── config/
│ │ ├── archivos/
│ │ │ ├── app.yaml
│ │ │ └── mensajes.yaml
│ │ ├── deltas/
│ │ │ └── generador
│ │ └── logotipos/
│ │ ├── nasa
│ │ └── softserve
│ └── negocio/
│ └── generador_reporte.py
└── trabajos/
├── trabajo.final.linux/
│ └── .gitkeep
└── trabajo.final.python/
└── criterios.evaluacion/
└── .gitkeep
SYMBOL INDEX (242 symbols across 65 files)
FILE: contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/decoradores_clases/decoradores.py
class MalaPractica (line 1) | class MalaPractica:
method __init__ (line 9) | def __init__(self):
method set_nombre (line 12) | def set_nombre(self, nombre: str) -> None:
method get_nombre (line 15) | def get_nombre(self) -> str:
class BuenaPractica (line 18) | class BuenaPractica:
method __init__ (line 26) | def __init__(self):
method nombre (line 30) | def nombre(self) -> str:
method nombre (line 34) | def nombre(self, nombre: str) -> None:
FILE: contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/decoradores_clases/estaticos.py
class Demo (line 1) | class Demo:
method saludar (line 3) | def saludar(self, nombre: str) -> None:
method saludar_estaticamente (line 12) | def saludar_estaticamente(nombre: str) -> None:
FILE: contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/decoradores_clases/metodos_de_clase.py
class Demo2 (line 1) | class Demo2:
method saludar (line 3) | def saludar(self, nombre: str) -> None:
method saludar_metodo_clase (line 12) | def saludar_metodo_clase(cls, nombre: str) -> None:
FILE: contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/documentacion/docs.py
class AutoDoc (line 12) | class AutoDoc:
method suma (line 25) | def suma(self, numero1: int, numero2: int, demo: bool = False) -> int:
method resta (line 40) | def resta(self, numero1: int, numero2: int) -> int:
method multiplicacion (line 47) | def multiplicacion(self, numero1: int, numero2: int) -> int:
method division (line 59) | def division(self, numero1: int, numero2: int) -> float:
FILE: contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/operaciones_matematicas/elementales.py
function suma (line 1) | def suma(numero1: int, numero2: int, demo: bool = False) -> int:
function resta (line 16) | def resta(numero1: int, numero2: int) -> int:
function multiplicacion (line 23) | def multiplicacion(numero1: int, numero2: int) -> int:
function division (line 35) | def division(numero1: int, numero2: int) -> float:
FILE: contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/operaciones_matematicas/elementales_objetos.py
class Elementales (line 1) | class Elementales:
method suma (line 2) | def suma(self, numero1: int, numero2: int) -> int:
method resta (line 5) | def resta(self, numero1: int, numero2: int) -> int:
method multiplicacion (line 8) | def multiplicacion(self, numero1: int, numero2: int) -> int:
method division (line 11) | def division(self, numero1: int, numero2: int) -> float:
class DatosPersona (line 14) | class DatosPersona:
FILE: contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/001.test_atributos.py
class Demo2 (line 53) | class Demo2:
FILE: contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/006.ms_call.py
function mi_func_sin_args (line 23) | def mi_func_sin_args():
function mi_func_con_args (line 28) | def mi_func_con_args():
function sesion_08 (line 46) | def sesion_08():
function sesion_08_02 (line 55) | def sesion_08_02():
function pao_pao_para_01 (line 67) | def pao_pao_para_01(nombre: str):
function pao_pao_para_02 (line 77) | def pao_pao_para_02(nombre: str):
function pao_pao_para_03 (line 88) | def pao_pao_para_03(nombre: str):
FILE: contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/especiales/ae_doc.py
class Demo (line 1) | class Demo:
FILE: contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/especiales/me_call.py
class Calculadora (line 5) | class Calculadora:
method __call__ (line 16) | def __call__(self, numero_1, numero_2):
class MiDecoradorElemental (line 21) | class MiDecoradorElemental:
method __init__ (line 26) | def __init__(self, function) -> None:
method __call__ (line 30) | def __call__(self, *args: Any, **kwds: Any) -> Any:
class MiDecoradorArgumentos (line 41) | class MiDecoradorArgumentos:
method __init__ (line 45) | def __init__(self, mensaje: str, delimitador: str = "*") -> None:
method __call__ (line 50) | def __call__(self, function) -> Any:
class MiDecoradorArgumentosYMetodos (line 73) | class MiDecoradorArgumentosYMetodos:
method __init__ (line 77) | def __init__(self, mensaje: str, delimitador: str = "*") -> None:
method __call__ (line 82) | def __call__(self, function) -> Any:
method pela_para_elena (line 105) | def pela_para_elena(cls, cuantas_veces_pao_pao: int):
FILE: contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/especiales/me_format.py
class MiNumero (line 1) | class MiNumero:
method __init__ (line 7) | def __init__(self, valor):
method __format__ (line 10) | def __format__(self, formato):
method formato (line 18) | def formato(self, formato):
FILE: contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/especiales/me_repr.py
class Persona (line 1) | class Persona:
method __init__ (line 9) | def __init__(self, nombre: str, edad: int):
method __repr__ (line 13) | def __repr__(self) -> str:
FILE: contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/especiales/me_repr_str.py
class Persona (line 1) | class Persona:
method __init__ (line 3) | def __init__(self, nombre: str, edad: int):
method __str__ (line 7) | def __str__(self) -> str:
method __repr__ (line 11) | def __repr__(self) -> str:
FILE: contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/especiales/me_str.py
class Persona (line 1) | class Persona:
method __init__ (line 10) | def __init__(self, nombre: str, edad: int):
method __str__ (line 14) | def __str__(self) -> str:
FILE: contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/generico/calculadora.py
class Calculadora (line 1) | class Calculadora:
method __init__ (line 3) | def __init__(self, numero_1, numero_2) -> None:
method suma (line 7) | def suma(self):
FILE: contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/generico/poo.py
class MyClass (line 1) | class MyClass:
FILE: contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/generico/procedural.py
function suma (line 1) | def suma(a: int, b: int) -> int:
FILE: contenido.curso/003.recursos/LVL-3/LVL3_09_excepciones/excepciones/elemental.py
class BootCampNivel1 (line 2) | class BootCampNivel1(Exception):
class BootCampNivel2 (line 12) | class BootCampNivel2(Exception):
method __init__ (line 16) | def __init__(self, codigo_error: int, mensaje: str) -> None:
class BootCampNivel3 (line 21) | class BootCampNivel3(Exception):
method __init__ (line 23) | def __init__(self, codigo_error: int, mensaje: str, nivel: str) -> None:
method __helper (line 30) | def __helper(self):
method __str__ (line 44) | def __str__(self):
FILE: contenido.curso/003.recursos/LVL-3/LVL3_10_programacion_funcional/asserts/complejo.py
function suma (line 2) | def suma(x: int, y: int, como_string: bool = False) -> int:
FILE: contenido.curso/003.recursos/LVL-3/LVL3_10_programacion_funcional/programacion_funcional/filter.py
function pares (line 7) | def pares(numero: int) -> int:
FILE: contenido.curso/003.recursos/LVL-3/LVL3_10_programacion_funcional/programacion_funcional/map.py
function al_cuadrado (line 12) | def al_cuadrado(numero: int) -> int:
FILE: contenido.curso/003.recursos/LVL-3/LVL3_10_programacion_funcional/programacion_funcional/reduce.py
function contador_palabras (line 25) | def contador_palabras(acumulador: dict, palabra: str) -> dict:
FILE: contenido.curso/003.recursos/LVL-4/LVL4.02.dependencias.ambientes.virtuales/paquetes.info/demo.py
function version (line 7) | def version():
function saludar (line 11) | def saludar(nombre):
function imprimir_logo (line 15) | def imprimir_logo():
FILE: contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/bootcamp/demo/utilities/demo.py
function version (line 7) | def version():
function saludar (line 11) | def saludar(nombre):
function imprimir_logo (line 15) | def imprimir_logo():
FILE: contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/paquetes.info/demo.py
function version (line 7) | def version():
function saludar (line 11) | def saludar(nombre):
function imprimir_logo (line 15) | def imprimir_logo():
FILE: contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/argparse/02_uso_argarser_opciones.py
function es_numero_positivo (line 4) | def es_numero_positivo(valor):
FILE: contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/loggin/uso_loggin_avanzado.py
function get_logger (line 7) | def get_logger(
FILE: contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/main/para_proyecto.py
class App (line 10) | class App: # opcional
FILE: contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/main/uso_main.py
function funcion_principal (line 6) | def funcion_principal():
FILE: contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/typing/uso_typing.py
function sumar_elementos (line 16) | def sumar_elementos(lista: List[int], edades: Dict[str, int], nombre: st...
function obtener_nombre (line 20) | def obtener_nombre(activo: bool, funcion: Callable[[str, int], bool], no...
FILE: contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/yaml/uso_yaml.py
function leer_yaml (line 5) | def leer_yaml(path: str) -> dict:
FILE: contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/calidad/pruebas/operaciones.py
function suma (line 1) | def suma(a, b):
function resta (line 5) | def resta(a, b):
function suma_mas_uno (line 9) | def suma_mas_uno(a, b):
FILE: contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/calidad/utilitarios/texto.py
class TextoUtil (line 5) | class TextoUtil:
method invertir_cadena_texto (line 8) | def invertir_cadena_texto(cadena: str) -> Tuple[str, int]:
FILE: contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/tests/conftest.py
function app (line 12) | def app(request):
FILE: contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/tests/pruebas/test_linting.py
function test_diccionario (line 4) | def test_diccionario(app):
function test_resultado (line 8) | def test_resultado(app):
FILE: contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/tests/pruebas/test_operaciones.py
function test_suma (line 3) | def test_suma(app):
function test_resta (line 7) | def test_resta(app):
FILE: contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/tests/utilitarios/test_texto.py
function test_probar_modulo_texto (line 4) | def test_probar_modulo_texto(app):
function test_invertir_cadena_texto (line 16) | def test_invertir_cadena_texto(app):
FILE: contenido.curso/003.recursos/LVL-5/LVL5.10.practica.final/componentes/get_header.py
function verificar_existencia_archivo (line 8) | def verificar_existencia_archivo(archivo):
function obtejer_parametros (line 14) | def obtejer_parametros() -> argparse:
function obtener_valores_encabezado (line 34) | def obtener_valores_encabezado(archivo: str, seccion: str) -> None:
FILE: contenido.curso/003.recursos/LVL-5/LVL5.10.practica.final/ingredientes/parse_args.py
function verificar_existencia_archivo (line 4) | def verificar_existencia_archivo(archivo):
function main (line 10) | def main():
FILE: material.apoyo/trabajo.final/V1/apolo-11.py
class App (line 17) | class App:
FILE: material.apoyo/trabajo.final/V1/nasa/comunes/constantes.py
class ValoresConstantesNoHarcodeados (line 5) | class ValoresConstantesNoHarcodeados:
method UNKN (line 14) | def UNKN(self) -> str:
method UNKNOWN (line 23) | def UNKNOWN(self) -> str:
method NOREPORT (line 32) | def NOREPORT(self) -> str:
method LOG (line 43) | def LOG(self) -> str:
method KILLED (line 52) | def KILLED(self) -> str:
method GENERADOR (line 61) | def GENERADOR(self) -> str:
method REPORTES (line 70) | def REPORTES(self) -> str:
method CONFIGAPP (line 79) | def CONFIGAPP(self) -> str:
method CONFMSG (line 88) | def CONFMSG(self) -> str:
method PANADAS (line 97) | def PANADAS(self) -> str:
method PYTHON (line 106) | def PYTHON(self) -> str:
FILE: material.apoyo/trabajo.final/V1/nasa/comunes/decoradores.py
class App (line 26) | class App:
method tiempo_ejecucion (line 29) | def tiempo_ejecucion(cls, mostrar_reporte: bool, ruta_logs: str = None):
FILE: material.apoyo/trabajo.final/V1/nasa/comunes/excepcion.py
class NasaAppException (line 9) | class NasaAppException(Exception):
method __init__ (line 17) | def __init__(self, codigo_error: int, mensaje: str, sys_info: sys.exc_...
method __helper (line 38) | def __helper(self) -> None:
method __str__ (line 51) | def __str__(self) -> str:
FILE: material.apoyo/trabajo.final/V1/nasa/comunes/inicializador.py
class Instanciador (line 16) | class Instanciador(AccionesDirectorios):
method __init__ (line 31) | def __init__(self, args: argparse.ArgumentParser, ruta_base: str):
method __cargar_configuracion_app (line 42) | def __cargar_configuracion_app(self, nombre_archivo: str) -> Struct:
method obtener_instancias_configuracion (line 64) | def obtener_instancias_configuracion(self) -> ObjetoTransversal:
FILE: material.apoyo/trabajo.final/V1/nasa/comunes/parametros.py
function obtener_args (line 15) | def obtener_args() -> argparse.ArgumentParser:
FILE: material.apoyo/trabajo.final/V1/nasa/comunes/utilitarios.py
class Funcionalidades (line 14) | class Funcionalidades:
method __init__ (line 17) | def __init__(self):
method configurar_logger (line 24) | def configurar_logger(
method LOGGER (line 61) | def LOGGER(self) -> logging.Logger:
method numeros_positivos (line 72) | def numeros_positivos(valor: str, mensaje: str = "valor invalido: '{va...
method leer_yaml (line 86) | def leer_yaml(ruta_archivo: str) -> Dict[str, Any]:
method obtener_encabezado (line 106) | def obtener_encabezado(logotipo: str, app: str, delimitador: str = "-"...
method escribir_yaml (line 124) | def escribir_yaml(datos: Dict[str, Any], archivo: str) -> None:
method describir_objeto (line 130) | def describir_objeto(cls) -> None:
class Struct (line 134) | class Struct:
method __init__ (line 140) | def __init__(self, **config: Dict[str, Any]):
FILE: material.apoyo/trabajo.final/V1/nasa/modelamiento/abstraccion/operaciones_os.py
class ArchivosDirectoriosABC (line 10) | class ArchivosDirectoriosABC(ABC):
method __init__ (line 18) | def __init__(self, objetoTransversal: ObjetoTransversal):
method crear_carpeta (line 27) | def crear_carpeta(self, ruta_carpeta: str) -> None:
method mover_carpeta (line 36) | def mover_carpeta(self, carpeta_origen: str, carpeta_destino: str) -> ...
method listar_archivos (line 47) | def listar_archivos(self, ruta: str) -> List[str]:
method delta (line 58) | def delta(self, ruta_archivo_delta: str, lectura: bool = True, valor_d...
method _preparar_nombre_carpeta (line 75) | def _preparar_nombre_carpeta(self, ruta: str, ciclo: int = 0) -> str:
FILE: material.apoyo/trabajo.final/V1/nasa/modelamiento/abstraccion/reportes.py
class Misiones (line 11) | class Misiones(ABC):
method __init__ (line 20) | def __init__(self, objetoTransversal: ObjetoTransversal):
method _preparar_nombre_carpeta (line 29) | def _preparar_nombre_carpeta(self, ruta: str, ciclo: int = 0) -> str:
method _obtener_info_archivos (line 44) | def _obtener_info_archivos(self, ruta_archivos: str) -> List[Dict[str,...
method _generar_analisis_eventos (line 55) | def _generar_analisis_eventos(self, df: pd.DataFrame, ruta_reporte: st...
method _generar_desconexiones (line 70) | def _generar_desconexiones(self, df: pd.DataFrame, ruta_reporte: str, ...
method _generar_dispositivos_inoperables (line 85) | def _generar_dispositivos_inoperables(self, df: pd.DataFrame, ruta_rep...
method _calcular_porcentajes (line 100) | def _calcular_porcentajes(self, df: pd.DataFrame, ruta_reporte: str, c...
method _generar_dashboard (line 117) | def _generar_dashboard(self, df_consolidado: pd.DataFrame, ruta_report...
method _preparar_nombre_reporte (line 132) | def _preparar_nombre_reporte(self, nombre_reporte: str, ruta_reporte: ...
method generar_reportes (line 147) | def generar_reportes(self) -> None:
FILE: material.apoyo/trabajo.final/V1/nasa/modelamiento/enumeradores/reportes.py
class CodigoReportes (line 8) | class CodigoReportes(Enum):
FILE: material.apoyo/trabajo.final/V1/nasa/modelamiento/herencia/acciones_os.py
class AccionesDirectorios (line 15) | class AccionesDirectorios(ArchivosDirectoriosABC):
method __init__ (line 18) | def __init__(self, objetoTransversal: ObjetoTransversal):
method crear_carpeta (line 26) | def crear_carpeta(self, ruta_carpeta: str) -> None:
method mover_carpeta (line 35) | def mover_carpeta(self, carpeta_origen: str, carpeta_destino: str) -> ...
method listar_archivos (line 45) | def listar_archivos(self, ruta: str) -> List[str]:
method delta (line 55) | def delta(self, ruta_archivo_delta: str, lectura: bool = True, valor_d...
method _preparar_nombre_carpeta (line 88) | def _preparar_nombre_carpeta(self, ruta: str, ciclo: int = 0) -> str:
FILE: material.apoyo/trabajo.final/V1/nasa/modelamiento/modelo/archivos.py
class ContenidoArchivo (line 9) | class ContenidoArchivo(BaseModel):
FILE: material.apoyo/trabajo.final/V1/nasa/modelamiento/propiedades/instancias.py
class ObjetoTransversal (line 10) | class ObjetoTransversal:
method __init__ (line 17) | def __init__(self):
method utilitarios (line 31) | def utilitarios(self) -> Funcionalidades:
method utilitarios (line 40) | def utilitarios(self, util: Funcionalidades):
method args (line 49) | def args(self) -> argparse.ArgumentParser:
method args (line 58) | def args(self, args: argparse.ArgumentParser):
method config (line 67) | def config(self) -> Struct:
method config (line 76) | def config(self, config: Struct):
method ruta_archivos (line 85) | def ruta_archivos(self) -> str:
method ruta_archivos (line 94) | def ruta_archivos(self, ruta: str):
method ruta_respaldo (line 103) | def ruta_respaldo(self) -> str:
method ruta_respaldo (line 112) | def ruta_respaldo(self, ruta: str):
method ruta_reportes (line 121) | def ruta_reportes(self) -> str:
method ruta_reportes (line 130) | def ruta_reportes(self, ruta: str):
method constante (line 139) | def constante(self) -> ValoresConstantesNoHarcodeados:
method constante (line 148) | def constante(self, constantes: ValoresConstantesNoHarcodeados):
method mensajes (line 157) | def mensajes(self) -> Struct:
method mensajes (line 166) | def mensajes(self, mensajes: Struct):
FILE: material.apoyo/trabajo.final/V1/nasa/negocio/generardor.py
class Archivos (line 15) | class Archivos(AccionesDirectorios):
method __init__ (line 23) | def __init__(self, objetoTransversal: ObjetoTransversal):
method __generar_archivos (line 36) | def __generar_archivos(self) -> None:
method ejecutar (line 117) | def ejecutar(self):
FILE: material.apoyo/trabajo.final/V1/nasa/negocio/reportes.py
class Pandas (line 21) | class Pandas(AccionesDirectorios, Misiones):
method __init__ (line 30) | def __init__(self, objetoTransversal: ObjetoTransversal):
method _preparar_nombre_carpeta (line 40) | def _preparar_nombre_carpeta(self, ruta: str, ciclo: int = 0) -> str:
method _obtener_info_archivos (line 64) | def _obtener_info_archivos(self, ruta_archivos: str) -> List[Dict[str,...
method _generar_analisis_eventos (line 83) | def _generar_analisis_eventos(self, df: pd.DataFrame, ruta_reporte: st...
method _generar_desconexiones (line 115) | def _generar_desconexiones(self, df: pd.DataFrame, ruta_reporte: str, ...
method _generar_dispositivos_inoperables (line 147) | def _generar_dispositivos_inoperables(self, df: pd.DataFrame, ruta_rep...
method _calcular_porcentajes (line 181) | def _calcular_porcentajes(self, df: pd.DataFrame, ruta_reporte: str, c...
method _generar_dashboard (line 216) | def _generar_dashboard(self, df_consolidado: pd.DataFrame, ruta_report...
method _preparar_nombre_reporte (line 245) | def _preparar_nombre_reporte(self, nombre_reporte: str, ruta_reporte: ...
method generar_reportes (line 267) | def generar_reportes(self) -> None:
class Python (line 372) | class Python(AccionesDirectorios, Misiones):
method __init__ (line 381) | def __init__(self, objetoTransversal: ObjetoTransversal):
method _preparar_nombre_carpeta (line 391) | def _preparar_nombre_carpeta(self, ruta: str, ciclo: int = 0) -> str:
method _obtener_info_archivos (line 415) | def _obtener_info_archivos(self, ruta_archivos: str) -> List[Dict[str,...
method _generar_analisis_eventos (line 433) | def _generar_analisis_eventos(
method _generar_desconexiones (line 495) | def _generar_desconexiones(self, datos: List[Dict[str, Any]], ruta_rep...
method _generar_dispositivos_inoperables (line 550) | def _generar_dispositivos_inoperables(
method _calcular_porcentajes (line 611) | def _calcular_porcentajes(
method _generar_dashboard (line 683) | def _generar_dashboard(self, datos: List[Dict[str, Any]], ruta_reporte...
method _preparar_nombre_reporte (line 727) | def _preparar_nombre_reporte(self, nombre_reporte: str, ruta_reporte: ...
method generar_reportes (line 750) | def generar_reportes(self) -> None:
FILE: material.apoyo/trabajo.final/V1/tests/comunes/constantes.py
function test_constantes (line 4) | def test_constantes():
FILE: material.apoyo/trabajo.final/V1/tests/comunes/decoradores.py
function test_tiempo_ejecucion_reporte (line 4) | def test_tiempo_ejecucion_reporte(capsys):
function test_tiempo_ejecucion_sin_reporte (line 22) | def test_tiempo_ejecucion_sin_reporte(capsys):
FILE: material.apoyo/trabajo.final/V1/tests/comunes/excepciones.py
function test_excepcion_personalizada (line 6) | def test_excepcion_personalizada():
FILE: material.apoyo/trabajo.final/V1/tests/comunes/inicializador.py
function test_obtener_instancias_configuracion (line 10) | def test_obtener_instancias_configuracion(capsys, argumentos_generador: ...
FILE: material.apoyo/trabajo.final/V1/tests/comunes/parametros.py
function test_argumentos_generador (line 6) | def test_argumentos_generador(capsys, argumentos_generador: List[str]):
function test_argumentos_reporte_pandas (line 25) | def test_argumentos_reporte_pandas(capsys, argumentos_reporte_pandas: Li...
function test_argumentos_reporte_python (line 44) | def test_argumentos_reporte_python(capsys, argumentos_reporte_python: Li...
function test_sin_argumentos (line 63) | def test_sin_argumentos():
FILE: material.apoyo/trabajo.final/V1/tests/comunes/utilitarios_funcionalidades.py
function test_configurar_logger (line 10) | def test_configurar_logger():
function test_escribir_yaml (line 23) | def test_escribir_yaml():
function test_leer_yaml (line 37) | def test_leer_yaml():
function test_obtener_encabezado (line 44) | def test_obtener_encabezado():
function test_numeros_positivos (line 52) | def test_numeros_positivos():
FILE: material.apoyo/trabajo.final/V1/tests/comunes/utilitarios_struct.py
function test_struct (line 4) | def test_struct() -> None:
FILE: material.apoyo/trabajo.final/V1/tests/conftest.py
function argumentos_generador (line 20) | def argumentos_generador() -> List[str]:
function argumentos_reporte_pandas (line 31) | def argumentos_reporte_pandas() -> List[str]:
function argumentos_reporte_python (line 43) | def argumentos_reporte_python() -> List[str]:
FILE: material.apoyo/trabajo.final/V1/tests/modelamiento/enumeradores.py
function test_enum_valores (line 4) | def test_enum_valores() -> None:
function test_enum_nombres (line 14) | def test_enum_nombres() -> None:
FILE: material.apoyo/trabajo.final/V1/tests/modelamiento/modelo.py
function test_pydantic (line 4) | def test_pydantic() -> None:
FILE: material.apoyo/trabajo.final/V1/tests/negocio/generador_reporte.py
function test_generar_archivos_pandas (line 12) | def test_generar_archivos_pandas(capsys, argumentos_generador: List[str]):
function test_generar_archivos_python (line 49) | def test_generar_archivos_python(capsys, argumentos_generador):
Condensed preview — 280 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (8,378K chars).
[
{
"path": ".github/workflows/notify.yml",
"chars": 1024,
"preview": "name: Notificar nuevo issue en Telegram\n\non:\n issues:\n types: [opened]\n\njobs:\n notify:\n runs-on: ubuntu-latest\n\n"
},
{
"path": ".github/workflows/send_telegram_message.py",
"chars": 694,
"preview": "import sys\nimport requests\nfrom datetime import datetime, timedelta\n\nbot_token = sys.argv[1]\ngroup_id = sys.argv[2]\nuser"
},
{
"path": ".gitignore",
"chars": 1892,
"preview": "# VSCODE\n\ndocker-compose.yml\npython\n# Pytest coverage may generate XML files\n*.xml\n\n# Byte-compiled / optimized / DLL fi"
},
{
"path": "LICENSE",
"chars": 1073,
"preview": "MIT License\n\nCopyright (c) 2023 codingupmyfuture\n\nPermission is hereby granted, free of charge, to any person obtaining "
},
{
"path": "README.md",
"chars": 3670,
"preview": "<img src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/1/13/SoftServe_logo_2017.svg/179px-SoftServe_logo_2017.sv"
},
{
"path": "contenido.curso/002.videos/001.welcome27072023.txt",
"chars": 98,
"preview": "\nlink video:\n https://drive.google.com/file/d/1Q1VWFpm5UI04JXHWT49zV02LQtpmjK_u/view?usp=sharing\n"
},
{
"path": "contenido.curso/002.videos/002.preguntas.respuestas.taller.txt",
"chars": 146,
"preview": "video realizado el 16/08/2023 para resolver dudas y respuestas\nhttps://drive.google.com/file/d/1lmo04EqV2-_8prOJfWuu_Qwt"
},
{
"path": "contenido.curso/003.recursos/LVL-1/LVL1.01.intro.ipynb",
"chars": 20567,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": [],\n \"toc_visible\": tr"
},
{
"path": "contenido.curso/003.recursos/LVL-1/LVL1.02.variables.print.ipynb",
"chars": 39421,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": [],\n \"toc_visible\": tr"
},
{
"path": "contenido.curso/003.recursos/LVL-1/LVL1.03.str.1.ipynb",
"chars": 25556,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-1/LVL1.04.str.2.ipynb",
"chars": 50150,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": [],\n \"toc_visible\": tr"
},
{
"path": "contenido.curso/003.recursos/LVL-1/LVL1.05.listas.tuplas.2.ipynb",
"chars": 47774,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {\n \"id\": \"qNgykDMA5hee\"\n },\n \"sou"
},
{
"path": "contenido.curso/003.recursos/LVL-1/LVL1.05.numeros.bool.1.ipynb",
"chars": 7204,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-1/LVL1.06.diccionarios.1.ipynb",
"chars": 20132,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {\n \"id\": \"S8gTUH4D-q12\"\n },\n \"sou"
},
{
"path": "contenido.curso/003.recursos/LVL-1/LVL1.07.diccionarios.2.ipynb",
"chars": 54171,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {\n \"id\": \"S8gTUH4D-q12\"\n },\n \"sou"
},
{
"path": "contenido.curso/003.recursos/LVL-1/LVL1.08.funciones.globales.ipynb",
"chars": 30839,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {\n \"id\": \"TiebQshlQiGx\"\n },\n \"sou"
},
{
"path": "contenido.curso/003.recursos/LVL-1/LVL1.08.sets.ipynb",
"chars": 30099,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {\n \"id\": \"d-e-x-GRK9Ej\"\n },\n \"sou"
},
{
"path": "contenido.curso/003.recursos/LVL-2/LVL2.01.operadores.metacon.ipynb",
"chars": 36154,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-2/LVL2.02.condicionales.ipynb",
"chars": 25129,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-2/LVL2.03.bucles.ipynb",
"chars": 37972,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-2/LVL2.04.bucles2.funciones.ipynb",
"chars": 24942,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": [],\n \"toc_visible\": tr"
},
{
"path": "contenido.curso/003.recursos/LVL-2/LVL2.05.funciones2.ipynb",
"chars": 28293,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-2/LVL2.06.funciones3.ipynb",
"chars": 33312,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-2/LVL2.07.format.ipynb",
"chars": 34333,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-2/LVL2.08.files1.ipynb",
"chars": 40247,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-2/LVL2.09.files2.ipynb",
"chars": 40407,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-2/LVL2.10.fechas.ipynb",
"chars": 17293,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/001_validador_elementales.py",
"chars": 1196,
"preview": "# import es la primera palabra, es sinónimo de todo\nimport operaciones_matematicas.elementales\n\n# as: 1. se usa para agr"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/002_validar_documentacion.py",
"chars": 117,
"preview": "from operaciones_matematicas.elementales import suma\nfrom documentacion.docs import AutoDoc\n\nhelp(suma)\nhelp(AutoDoc)"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/003_validar_estaticos.py",
"chars": 194,
"preview": "from decoradores_clases.estaticos import Demo\n\n\n# Demo.saludar(\"lvl3\")\ndemo = Demo()\ndemo.saludar(\"LVL3\")\n\nDemo.saludar_"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/004_metodos_de_clase.py",
"chars": 286,
"preview": "from decoradores_clases.metodos_de_clase import Demo2\n\n# demo = Demo() | instancia manual - podemos saber cuál es el obj"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/005_get_set.py",
"chars": 684,
"preview": "from decoradores_clases.decoradores import MalaPractica, BuenaPractica\n\n\nprint(\"imprimiendo tipo Java - NO recomendado\"."
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/README.md",
"chars": 1571,
"preview": "# NOTAS\n\n## DOCUMENTACIÓN\n* recuerden que para librerías, paquetes y módulos, los nombres no deben llevar tildes\n* los c"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/decoradores_clases/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/decoradores_clases/decoradores.py",
"chars": 1000,
"preview": "class MalaPractica:\n \"\"\"\n los famosos getters and setters\n getter: obtener un atributo de la clase\n "
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/decoradores_clases/estaticos.py",
"chars": 523,
"preview": "class Demo:\n \n def saludar(self, nombre: str) -> None:\n \"\"\"método al que se accede por instancia para salud"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/decoradores_clases/metodos_de_clase.py",
"chars": 695,
"preview": "class Demo2:\n \n def saludar(self, nombre: str) -> None:\n \"\"\"método al que se accede por instancia para salu"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/docs/clase.docs.txt",
"chars": 2930,
"preview": "Help on module documentacion.docs in documentacion:\n\nNAME\n documentacion.docs\n\nCLASSES\n builtins.object\n Au"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/documentacion/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/documentacion/docs.py",
"chars": 2287,
"preview": "\n__author__ = \"luis.vergara@..\"\n__copyright__ = \"todos los derechos reservados\"\n__license__ = \"MIT\"\n__credits__= \"A mis "
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/documentacion.docs.html",
"chars": 6774,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<html><head><title>Python: module documentacion.docs</tit"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/operaciones_matematicas/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/operaciones_matematicas/elementales.py",
"chars": 1296,
"preview": "def suma(numero1: int, numero2: int, demo: bool = False) -> int:\n \"\"\"esta función permite realizar la suma de dos núm"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LV3_05_06_poo_3_4/operaciones_matematicas/elementales_objetos.py",
"chars": 444,
"preview": "class Elementales: \n def suma(self, numero1: int, numero2: int) -> int:\n return numero1 + numero2\n\n def "
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3.01.clases.ipynb",
"chars": 18733,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3.02.clases.metadata.ipynb",
"chars": 47129,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3.03.cuatro.pilares.poo.1.ipynb",
"chars": 32668,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3.04.cuatro.pilares.poo.2.ipynb",
"chars": 53429,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/001.test_atributos.py",
"chars": 1801,
"preview": "from generico.procedural import suma as sm\nfrom generico.poo import MyClass as Demo\n\n\"\"\"\n__name__: Este atributo proporc"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/002.ms_rep.py",
"chars": 250,
"preview": "from generico.poo import MyClass as Demo\nfrom especiales.me_repr import Persona\n\ndemo = Demo()\nprint(\"normal (instancia)"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/003.ms_str.py",
"chars": 249,
"preview": "from generico.poo import MyClass as Demo\nfrom especiales.me_str import Persona\n\ndemo = Demo()\nprint(\"normal (instancia) "
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/004.ms_str_rep.py",
"chars": 361,
"preview": "from generico.poo import MyClass as Demo\nfrom especiales.me_repr_str import Persona\n\ndemo = Demo()\nprint(\"normal (instan"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/005.at_doc.py",
"chars": 75,
"preview": "from especiales.ae_doc import Demo\nprint(Demo.__dict__)\nprint(Demo.__doc__)"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/006.ms_call.py",
"chars": 2376,
"preview": "from generico.calculadora import Calculadora\nfrom especiales.me_call import (\n Calculadora as CalculadoraCall,\n Mi"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/007.ms_format.py",
"chars": 983,
"preview": "# cadena.format()\n# help(format)\nfrom especiales.me_format import MiNumero\n\nprint(\"\\n ------------ \\n\")\nprint(\"[LVL1] no"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/README.md",
"chars": 603,
"preview": "# **METODOS & ATRIBUTOS ESPECIALES**\n\nEn Python, los métodos especiales, también conocidos como \"métodos dunder\" (abrevi"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/especiales/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/especiales/ae_doc.py",
"chars": 61,
"preview": "class Demo:\n __doc__ = \"otra forma de documentar\"\n pass"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/especiales/me_call.py",
"chars": 4628,
"preview": "# lo veremos en nivel para referenciar los tipos de datos\nfrom typing import Any\n\n\nclass Calculadora:\n \"\"\"\n CALLAB"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/especiales/me_format.py",
"chars": 782,
"preview": "class MiNumero:\n \"\"\"__format__: se utiliza para personalizar la representación de \n formato de un objeto cuando se"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/especiales/me_repr.py",
"chars": 481,
"preview": "class Persona:\n \"\"\"\n __repr__\n utilizado para crear una representación de cadena de un objeto\n "
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/especiales/me_repr_str.py",
"chars": 428,
"preview": "class Persona:\n\n def __init__(self, nombre: str, edad: int):\n self.nombre = nombre\n self.edad = edad\n "
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/especiales/me_str.py",
"chars": 612,
"preview": "class Persona:\n \"\"\"\n __str__\n utilizado para crear una representación de cadena de un objeto\n\n "
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/generico/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/generico/calculadora.py",
"chars": 215,
"preview": "class Calculadora:\n \n def __init__(self, numero_1, numero_2) -> None:\n self.__numero_1 = numero_1\n s"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/generico/poo.py",
"chars": 44,
"preview": "class MyClass:\n \"\"\"clase demo\"\"\"\n pass"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_07_08_clases_especiales/generico/procedural.py",
"chars": 97,
"preview": "def suma(a: int, b: int) -> int:\n \"\"\"Esta función suma dos números enteros\"\"\"\n return a + b"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_09_excepciones/000.excepciones.ipynb",
"chars": 6737,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {},\n \"source\": [\n \"<p><img src=\\\"https://i.postimg.cc/"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_09_excepciones/001.elemental.py",
"chars": 228,
"preview": "from excepciones.elemental import BootCampNivel1\n\n\ntry:\n print(\"probando nuestra excepción\")\n raise BootCampNivel1"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_09_excepciones/002.conmassazon.py",
"chars": 325,
"preview": "from excepciones.elemental import BootCampNivel2\n\n\ntry:\n print(\"probando nuestra excepción\")\n raise BootCampNivel2"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_09_excepciones/003.excepcioncarinosa.py",
"chars": 471,
"preview": "from excepciones.elemental import BootCampNivel3\n\n\ntry:\n print(\"probando nuestra excepción\")\n raise BootCampNivel3"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_09_excepciones/004.otro_tipo_de_captura.py",
"chars": 512,
"preview": "import sys\nimport json\n\ntry:\n 1/0\nexcept Exception as ex:\n # santo grial, poco conocido sys.exc_info()\n exc_ty"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_09_excepciones/005.assert.py",
"chars": 47,
"preview": "x = 1\nassert x == 2, \"el valor no es igual a 1\""
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_09_excepciones/README.md",
"chars": 986,
"preview": "# EXCEPCIONES\n\nuna interrupción brusca a la ejecución de mi programa (profundizar). Estas excepciones, en un proyecto gr"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_09_excepciones/excepciones/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_09_excepciones/excepciones/elemental.py",
"chars": 1251,
"preview": "\nclass BootCampNivel1(Exception):\n \"\"\"cuando se quieran crear excepciones personalizadas\n la clase siempre deb"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_10_programacion_funcional/README.md",
"chars": 1089,
"preview": "\n## ASSERTS \n\nEl assert es una instrucción de Python que te permite definir \ncondiciones que deben cumplirse siempre. En"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_10_programacion_funcional/asserts/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_10_programacion_funcional/asserts/complejo.py",
"chars": 358,
"preview": "\ndef suma(x: int, y: int, como_string: bool = False) -> int:\n if como_string:\n return str(x + y)\n else:\n "
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_10_programacion_funcional/asserts/con_mensaje.py",
"chars": 168,
"preview": "\nx: int = 1\n# cuando es verdadero, no pasa nada\n# condición que de un booleano y luego le agrega la , y el mensaje\nasser"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_10_programacion_funcional/asserts/ok.py",
"chars": 88,
"preview": "\nx: int = 1\n# cuando es verdadero no pasa nada\nassert x == 1\n\n\nprint(\"no pasó nadaaaa!\")"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_10_programacion_funcional/asserts/sin_mensaje.py",
"chars": 60,
"preview": "\nx: int = 1\n# cuando es verdadero no pasa nada\nassert x == 2"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_10_programacion_funcional/programacion_funcional/filter.py",
"chars": 528,
"preview": "\nfrom typing import List\n\nlista_numeros: List[int] = [1,2,3,4,5,6,7,8,9,10]\n\n# [NIVEL1] forma declarada\ndef pares(numero"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_10_programacion_funcional/programacion_funcional/map.py",
"chars": 863,
"preview": "\nfrom typing import List\n\nlista_numeros: List[int] = [1,2,3,4,5,6,7,8,9,10]\nlista_correos: List[str] = [\n \"MeQuierOmo"
},
{
"path": "contenido.curso/003.recursos/LVL-3/LVL3_10_programacion_funcional/programacion_funcional/reduce.py",
"chars": 1723,
"preview": "from functools import reduce\nimport json\n\n\nmensaje: str = \"\"\"\nEste es un mensaje de PRueBA con algunas PALABRAS en MAYÚS"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.01.estructuracion.proyecto/001.video.sesion.txt",
"chars": 82,
"preview": "https://drive.google.com/file/d/1RInZtlrVsltnkN4RJv7sBJ8MmzZZTLHe/view?usp=sharing"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.01.estructuracion.proyecto/README.md",
"chars": 2804,
"preview": "<img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"reporte\" border=\"0\"/>\n\n\n# USO DE SCRUM EN EL DESARROLLO DE SOF"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.02.dependencias.ambientes.virtuales/001.RUTAS.ENVARIABLES.md",
"chars": 2338,
"preview": "<img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"reporte\" border=\"0\"/>\n\n# **RUTAS DEL SISTEMA & VARIABLES DE EN"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.02.dependencias.ambientes.virtuales/002.LIBRERIAS.md",
"chars": 3297,
"preview": "<img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"reporte\" border=\"0\"/>\n\n# **LIBRERÍAS**\n \n\nLas librerías en "
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.02.dependencias.ambientes.virtuales/003.AMBIENTES.VIRTUALES.md",
"chars": 4940,
"preview": "<img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"reporte\" border=\"0\"/>\n\n\n\n# **AMBIENTES VIRTUALES (environment "
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.02.dependencias.ambientes.virtuales/README.md",
"chars": 1477,
"preview": "\n<img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"reporte\" border=\"0\"/>\n\n\n\n# **ASPECTOS ELEMENTALES A CONSIDERA"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.02.dependencias.ambientes.virtuales/directorios.archivos.info/os.sys.ipynb",
"chars": 29552,
"preview": "{\n \"cells\": [\n {\n \"cell_type\": \"markdown\",\n \"metadata\": {\n \"id\": \"2peEz_NWxEeN\"\n },\n \"sou"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.02.dependencias.ambientes.virtuales/paquetes.info/demo.py",
"chars": 1083,
"preview": "\n\nVERSION_LARGA:str = f\"1.0.0 generada el 23/11/2023\"\n\n\n@property\ndef version():\n return \"1.0.0\"\n\n\ndef saludar(nombre"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.02.dependencias.ambientes.virtuales/paquetes.info/libreriapropia.py",
"chars": 192,
"preview": "import bootcamp.demo as demo\n\ndemo.imprimir_logo()\nprint(\"\")\nprint(demo.saludar(\"espartan@s\"))\nprint(f\"version corta : {"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.02.dependencias.ambientes.virtuales/paquetes.info/sistema.py",
"chars": 207,
"preview": "import site\n\nprint(f\"site.getsitepackages ---> {site.getsitepackages()}\")\nprint(f\"site.getusersitepackages ---> {sit"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.02.dependencias.ambientes.virtuales/paquetes.info/truco.sh",
"chars": 593,
"preview": "\n# código solo UNIX (Mac & Linux)\n\n# tomo la ubicación de site-packages\nSPACKAGES=$(python -c \"import site; print(site.g"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.02.dependencias.ambientes.virtuales/sistema.info/envariables.libexterna.py",
"chars": 257,
"preview": "from dotenv import dotenv_values\n\n# cargar variables desde el archivo .env en un diccionario\nconfig = dotenv_values(\".en"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.02.dependencias.ambientes.virtuales/sistema.info/envariables.manuales.py",
"chars": 403,
"preview": "import os\n\n# ruta al archivo .env\nenv_path = \".env\"\n\n# lee el archivo .env y configura las variables de entorno\nwith ope"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.02.dependencias.ambientes.virtuales/sistema.info/sistema.py",
"chars": 852,
"preview": "import os\n\nprint(f\"nombre del sistema operativo : {os.name}\")\nprint(f\"separador de ruta : {os.sep}\") # *\nprin"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/README.md",
"chars": 6460,
"preview": "<img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"reporte\" border=\"0\"/>\n\n\n\n# **CREACIÓN DE PROYECTO**\n\n\nLa creac"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/bootcamp/README.md",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/bootcamp/demo/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/bootcamp/demo/config/files/.gitkeep",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/bootcamp/demo/config/images/.gitkeep",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/bootcamp/demo/config/messages/mensajes.json",
"chars": 102,
"preview": "{\n \"es\": {\n \"hi\": \"hola a todos!\"\n },\n \"en\": {\n \"hi\": \"hello everyone!\"\n }\n}"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/bootcamp/demo/utilities/demo.py",
"chars": 1083,
"preview": "\n\nVERSION_LARGA:str = f\"1.0.0 generada el 23/11/2023\"\n\n\n@property\ndef version():\n return \"1.0.0\"\n\n\ndef saludar(nombre"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/bootcamp/pyproject.toml",
"chars": 570,
"preview": "[tool.poetry]\nname = \"demo\"\nversion = \"1.1.0\"\ndescription = \"\"\nauthors = [\"luisvasv\"]\nreadme = \"README.md\"\nlicense = \"MI"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/bootcamp/tests/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/paquetes.info/demo.py",
"chars": 1083,
"preview": "\n\nVERSION_LARGA:str = f\"1.0.0 generada el 23/11/2023\"\n\n\n@property\ndef version():\n return \"1.0.0\"\n\n\ndef saludar(nombre"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/paquetes.info/truco.sh",
"chars": 593,
"preview": "\n# código solo UNIX (Mac & Linux)\n\n# tomo la ubicación de site-packages\nSPACKAGES=$(python -c \"import site; print(site.g"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/proyecto_igual/README.md",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/proyecto_igual/proyecto_igual/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/proyecto_igual/pyproject.toml",
"chars": 289,
"preview": "[tool.poetry]\nname = \"proyecto-igual\"\nversion = \"0.1.0\"\ndescription = \"\"\nauthors = [\"luisvasv\"]\nreadme = \"README.md\"\npac"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/proyecto_igual/tests/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/proyecto_manual/README.md",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/proyecto_manual/librerias/utilitarios/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/proyecto_manual/requirements.txt",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/proyecto_noigual/README.md",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/proyecto_noigual/apibootcamp/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/proyecto_noigual/pyproject.toml",
"chars": 244,
"preview": "[tool.poetry]\nname = \"apibootcamp\"\nversion = \"0.1.0\"\ndescription = \"\"\nauthors = [\"luisvasv\"]\nreadme = \"README.md\"\n\n[tool"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.03.creacion.proyecto/proyecto_noigual/tests/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/001.YAML.md",
"chars": 1899,
"preview": "## **YAML**\n\nYAML (*YAML Ain't Markup Language*) es un formato de serialización de datos legible por humanos que se util"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/002.LOGGIN.md",
"chars": 2460,
"preview": "## **LOGGIN**\n\n\n<img src=\"https://miro.medium.com/v2/resize:fit:720/format:webp/1*Ua-aPvEQAcymzVcE2GmVEw.jpeg\" alt=\"repo"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/003.TYPING.md",
"chars": 1825,
"preview": "## **TYPING**\n\nEs un módulo en Python que se introdujo en la `versión 3.5` y se utiliza para proporcionar tipos de datos"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/004.ENTRYPOINT.md",
"chars": 764,
"preview": "## **ENTRYPOINT**\n\n\nUn \"**entry point**\" (*punto de entrada*) en el contexto de la programación, especialmente en Python"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/005.SYSARGS.md",
"chars": 767,
"preview": "## **SYS ARGS**\n\nLos **argumentos de línea de comandos** son cadenas de texto o valores proporcionados al ejecutar un pr"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/006.ARGPARSE.md",
"chars": 2189,
"preview": "### **ARGPARSE**\n\nEs un analizador de argumentos de línea de comandos que se utiliza para procesar y manejar los argumen"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/README.md",
"chars": 1634,
"preview": "<img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"reporte\" border=\"0\"/>\n\n\n# **BUENAS PRÁCTICAS EN PROGRAMACIÓN**"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/config/mensajes.yaml",
"chars": 110,
"preview": "es:\n welcome: Bienvenido!\n error: ocurrió un problema.\n\nen:\n welcome: Welcome!\n error: something happened!"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/config/simple.yaml",
"chars": 76,
"preview": "nombre: Bootcamp\nedad: 1\nvalido: true\nvocales:\n - a\n - e\n - i\n - o\n - u"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/argparse/01_uso_parser_elemental.py",
"chars": 415,
"preview": "import argparse\nparser = argparse.ArgumentParser(\n prog='BootcampDemo',\n descripti"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/argparse/02_uso_argarser_opciones.py",
"chars": 1170,
"preview": "import argparse\n\n# función definida por el usuario para validar si el valor es un número positivo\ndef es_numero_positivo"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/loggin/simple.py",
"chars": 516,
"preview": "import logging\n\n# configurar el nivel\nlogging.basicConfig(level=logging.ERROR)\n\n# ejemplos de registro de mensajes\nloggi"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/loggin/uso_loggin_avanzado.py",
"chars": 1326,
"preview": "import logging\nimport os\nimport sys\nfrom datetime import datetime\nfrom logging import handlers\n\ndef get_logger(\n app_"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/main/para_proyecto.py",
"chars": 1413,
"preview": "# importan librerías\n\n# importa la clase que contiene la lógica que se necesita\n# from utilidades import Bootcamp\n\n# coo"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/main/uso_main.py",
"chars": 321,
"preview": "\nimport sys\n\nprint(\"0 ----- compila todo\")\n\ndef funcion_principal():\n print(\"2 ----- Función principal ejecutada\")\n\ni"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/sysargs/uso_sysargs.py",
"chars": 824,
"preview": "import sys\nimport logging\n\n\n\"\"\"\nque pasa si recibo un valor que es una letra, o un valor diferente a \n0\n20\n30\n40\n50\n\"\"\"\n"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/typing/uso_typing.py",
"chars": 893,
"preview": "from typing import List, Tuple, Dict, Optional, Callable, Any, Union\n# NOTA: para datos complejos\n\n# [1.variables]\ntexto"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/snipcode/yaml/uso_yaml.py",
"chars": 520,
"preview": "import yaml\nfrom yaml.loader import SafeLoader\n\n\ndef leer_yaml(path: str) -> dict:\n \"\"\"permite leer un archivo yaml y"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/test_loggin.py",
"chars": 419,
"preview": "import logging\nfrom snipcode.loggin.uso_loggin_avanzado import get_logger\n\n\nmy_log = get_logger(\"evelyn\", logger_level ="
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.04.buenas.practicas.1/test_yaml.py",
"chars": 415,
"preview": "import json\nfrom typing import Any, Dict\nfrom snipcode.yaml.uso_yaml import leer_yaml\n\nprint(\"\\n -- simple --\\n\")\nconten"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.05.git.basico/001.video.sesion.txt",
"chars": 83,
"preview": "https://drive.google.com/file/d/12E53Yn3KV2sm0AL1vOlNJGyCJsuY120C/view?usp=sharing\n"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.05.git.basico/Dockerfile",
"chars": 172,
"preview": "# opcional | para el que quiera mirar Docker\n# docker build -t demo . \n# docker run -it demo bash\nFROM ubuntu:late"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.05.git.basico/README.md",
"chars": 6948,
"preview": "<img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"reporte\" border=\"0\"/>\n\n\n# **MANEJO DE PROYECTOS CON GIT**\n\n## "
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/FLAKE8.md",
"chars": 1442,
"preview": "<img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"reporte\" border=\"0\"/>\n\n\n# **FLAKE8**\n\nFlake8 es una librería P"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/PYTEST.md",
"chars": 2136,
"preview": "<img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"reporte\" border=\"0\"/>\n\n\n# **PYTEST**\n\nPyTest es un marco de tr"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/README.md",
"chars": 5479,
"preview": "<img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"reporte\" border=\"0\"/>\n\n\n# **ESTANDAR DE CALIDAD EN UN PROYECTO"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/Makefile",
"chars": 683,
"preview": "\n\n.PHONY: clean lint mypy lint dist\n\nclean: clean-envs clean-pyc clean-test clean-dist\n\nclean-envs:\n\trm -rf env\n\nclean-p"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/README.md",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/borrar.py",
"chars": 110,
"preview": "from calidad.utilitarios.texto import TextoUtil\n\ndatos = TextoUtil.invertir_cadena_texto(\"AEIOU\")\nprint(datos)"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/calidad/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/calidad/config/files/demo.yaml",
"chars": 13,
"preview": "secuencia: 20"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/calidad/pruebas/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/calidad/pruebas/linting.py",
"chars": 104,
"preview": "diccionario = {\n \"a\": 1,\n \"b\": 2,\n}\n\ndiccionario[\"nueva_clave\"] = \"nuevo_valor\"\nresultado = 5 + 3\n"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/calidad/pruebas/operaciones.py",
"chars": 115,
"preview": "def suma(a, b):\n return a + b\n\n\ndef resta(a, b):\n return a - b\n\n\ndef suma_mas_uno(a, b):\n return a + b + 1"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/calidad/utilitarios/texto.py",
"chars": 812,
"preview": "\nfrom typing import Tuple\n\n\nclass TextoUtil:\n\n @staticmethod\n def invertir_cadena_texto(cadena: str) -> Tuple[str,"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/pyproject.toml",
"chars": 420,
"preview": "[tool.poetry]\nname = \"calidad\"\nversion = \"0.1.0\"\ndescription = \"\"\nauthors = [\"luisvasv\"]\nreadme = \"README.md\"\n\n[tool.poe"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/setup.cfg",
"chars": 309,
"preview": "[flake8]\nignore = E712\nmax-line-length = 120\nmax-complexity = 10\n\n[tool:pytest]\naddopts = --doctest-modules tests \n -"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/tests/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/tests/conftest.py",
"chars": 559,
"preview": "\"\"\"para definir configuración transversal que pueden ser usados \nen las diferentes pruebas unitarias.\n\ntodas las pruebas"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/tests/pruebas/test_linting.py",
"chars": 214,
"preview": "\nfrom calidad.calidad.pruebas.linting import diccionario, resultado\n\ndef test_diccionario(app):\n assert diccionario[\""
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/tests/pruebas/test_operaciones.py",
"chars": 132,
"preview": "\n\ndef test_suma(app):\n \n assert app.funcion_suma(5, 5) == 10\n \ndef test_resta(app):\n assert app.funcion_rest"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.06.07.buenas.practicas.2/calidad/tests/utilitarios/test_texto.py",
"chars": 643,
"preview": "from calidad.calidad.utilitarios.texto import TextoUtil\n\n\ndef test_probar_modulo_texto(app):\n assert 1 == 1\n caso_"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.08.dataclases.pydantic/README.md",
"chars": 197,
"preview": "<img src=\"https://i.postimg.cc/cCjTSn8r/ss-cumf.png\" alt=\"reporte\" border=\"0\"/>\n\n\n\n## **TIPS TRABAJO FINAL**\n\nPara el tr"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.08.dataclases.pydantic/dataclases.pydantic.ipynb",
"chars": 52642,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.08.dataclases.pydantic/video.clase.txt",
"chars": 82,
"preview": "https://drive.google.com/file/d/1Cwvk0znj1OFIFRHS-gyb9DikCJwkm4lu/view?usp=sharing"
},
{
"path": "contenido.curso/003.recursos/LVL-4/LVL4.09.expresiones.regulares/LVL4.09.expresiones.regulares.ipynb",
"chars": 15725,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.01.intro.linux/linux.000.intro.ipynb",
"chars": 458119,
"preview": "{\n \"nbformat\": 4,\n \"nbformat_minor\": 0,\n \"metadata\": {\n \"colab\": {\n \"provenance\": []\n },\n \"kernelspec\":"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.01.intro.linux/video.txt",
"chars": 82,
"preview": "https://drive.google.com/file/d/14fFgUCoBVHNgHWgFOd5IEo833-K8Gn5X/view?usp=sharing"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.02.intro.consola/comandos.txt",
"chars": 907,
"preview": "\n# generar ayudas para el comando cal usando man y help\n\ncal --help\nman cal\n\n# algunas funciones de cal\ncal\n\ncal -y \ncal"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.03.intro.os/comandos.txt",
"chars": 907,
"preview": "\n# generar ayudas para el comando cal usando man y help\n\ncal --help\nman cal\n\n# algunas funciones de cal\ncal\n\ncal -y \ncal"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.03.intro.os/demo.py",
"chars": 14,
"preview": "print('demo')\n"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.03.intro.os/demo_error.py",
"chars": 37,
"preview": "import sys\nprint('demo')\nsys.exit(2)\n"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.03.intro.os/info_comandos.txt",
"chars": 816,
"preview": "columna #1 -> -rw-r--r-- 1 | longitud de 10\n [tipo archivo[1]|per usuario[3]|pergrupo[3]|per otros[3]]\n posicion 1 -->"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.03.intro.os/labp.txt",
"chars": 0,
"preview": ""
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.03.intro.os/sesion_5.json",
"chars": 959229,
"preview": "{\"version\": 2, \"width\": 106, \"height\": 32, \"timestamp\": 1707257583, \"env\": {\"SHELL\": \"/bin/zsh\", \"TERM\": \"xterm-256color"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.04.intro.os.dos/seson_4.cast",
"chars": 1322655,
"preview": "{\"version\": 2, \"width\": 156, \"height\": 45, \"timestamp\": 1707430150, \"env\": {\"SHELL\": \"/bin/zsh\", \"TERM\": \"xterm-256color"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.05.vim.operadores/001.vim.comandos.txt",
"chars": 1389,
"preview": "5. i -> Entrar al modo de inserción antes del cursor\n6. I -> Entrar al modo de inserción al inicio de la l"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.05.vim.operadores/datasets/col.deptos.txt",
"chars": 738,
"preview": "ID_DEPARTAMENTO,NOMBRE,ID_PAIS,DIVIPO\n1,ANTIOQUIA,1,05001\n2,ATLANTICO,1,08001\n3,BOGOTA D. C.,1,11001\n4,BOLIVAR,1,13001\n5"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.05.vim.operadores/datasets/columnas.txt",
"chars": 124,
"preview": "1) Amit Physics 80\n2) Rahul Maths 90\n3) Shyam Biology 87\n4) Kedar English 85\n5) Hari History "
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.05.vim.operadores/datasets/ips.txt",
"chars": 546,
"preview": "supernoder1 50.116.30.23\nsupernoder2 198.58.103.28 \nsupernoder3 198.58.103.36 \nsupernoder4 198.58.102.49 \nsupernoder5 19"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.05.vim.operadores/datasets/logs.txt",
"chars": 35,
"preview": "holaaaaa\nlos quiero\nssssss\nsssdsds\n"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.05.vim.operadores/datasets/nf.txt",
"chars": 171,
"preview": "ID_DEPARTAMENTO,NOMBRE,ID_PAIS,DIVIPO\n1,ANTIOQUIA,1,05001\n2,ATLANTICO,1,08001\n3,BOGOTA D. C.,1,11001\n4,BOLIVAR,1,13001\n5"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.05.vim.operadores/s5.cast",
"chars": 958784,
"preview": "{\"version\": 2, \"width\": 121, \"height\": 37, \"timestamp\": 1708034756, \"env\": {\"SHELL\": \"/bin/zsh\", \"TERM\": \"xterm-256color"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.06.programacion.1/archivos_eliminar.txt",
"chars": 150,
"preview": "datasets/col.deptos.txt\ndatasets/col.deptos.txt\ndatasets/col.deptos.txt\ndatasets/col.deptos.txt\ndatasets/nf.txt\ndatasets"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.06.programacion.1/datasets/col.deptos.txt",
"chars": 738,
"preview": "ID_DEPARTAMENTO,NOMBRE,ID_PAIS,DIVIPO\n1,ANTIOQUIA,1,05001\n2,ATLANTICO,1,08001\n3,BOGOTA D. C.,1,11001\n4,BOLIVAR,1,13001\n5"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.06.programacion.1/datasets/columnas.txt",
"chars": 124,
"preview": "1) Amit Physics 80\n2) Rahul Maths 90\n3) Shyam Biology 87\n4) Kedar English 85\n5) Hari History "
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.06.programacion.1/datasets/ips.txt",
"chars": 546,
"preview": "supernoder1 50.116.30.23\nsupernoder2 198.58.103.28 \nsupernoder3 198.58.103.36 \nsupernoder4 198.58.102.49 \nsupernoder5 19"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.06.programacion.1/datasets/logs.txt",
"chars": 35,
"preview": "holaaaaa\nlos quiero\nssssss\nsssdsds\n"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.06.programacion.1/datasets/nf.txt",
"chars": 171,
"preview": "ID_DEPARTAMENTO,NOMBRE,ID_PAIS,DIVIPO\n1,ANTIOQUIA,1,05001\n2,ATLANTICO,1,08001\n3,BOGOTA D. C.,1,11001\n4,BOLIVAR,1,13001\n5"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.06.programacion.1/docs/formato.fecha.avanzado.txt",
"chars": 2282,
"preview": "FORMAT controls the output. Interpreted sequences are:\n\n %% a literal %\n %a locale's abbreviated weekday name (e."
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.06.programacion.1/docs/formato.fecha.elemental.txt",
"chars": 695,
"preview": "%a\tNombre local abreviado de día de semana\n%A\tNombre local completo de día de semana\n%b\tNombre local abreviado de mes\n%B"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.06.programacion.1/s6.cast",
"chars": 602361,
"preview": "{\"version\": 2, \"width\": 95, \"height\": 21, \"timestamp\": 1708467206, \"env\": {\"SHELL\": \"/bin/zsh\", \"TERM\": \"xterm-256color\""
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.06.programacion.1/variables.sh",
"chars": 2556,
"preview": "# asignado variable al resultado\n# regla de oro: rutas en absoluto, igual que los archivos\nRUTA_ACTUAL=$(pwd)\nhola=\"XYZ\""
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.07.programacion.2/000.comentarios.sh",
"chars": 127,
"preview": "#!/bin/bash\n\n# esto es un comentario simple\n\n<< 'MULTILINE-COMMENT'\n esto es un comentario multi\n linea\nMULTILINE-"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.07.programacion.2/001.if.sh",
"chars": 857,
"preview": "#!/bin/bash\n\n# validaciones de textos \n# condicional elemental\nif [ \"1\" == \"1\" ]; then\n echo \"[*****] entro a la cond"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.07.programacion.2/002.for.sh",
"chars": 984,
"preview": "#!/bin/bash\n\n# simple\nelementos=(1 2 3 4 5 6 7 8 9 10)\necho \"cantidad de elementos: ${#elementos[@]}\"\n\n# iterando lista\n"
},
{
"path": "contenido.curso/003.recursos/LVL-5/LVL5.07.programacion.2/003.while.sh",
"chars": 189,
"preview": "#!/bin/bash\n\nnumero=0\n\n# while en linux\nwhile [ $numero -le 10 ]; do \n echo \"[ITER] el numero es $numero\"\n # sumar"
}
]
// ... and 80 more files (download for full content)
About this extraction
This page contains the full source code of the codingupmyfuture/bootcamplinuxpython GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 280 files (7.3 MB), approximately 1.9M tokens, and a symbol index with 242 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.