├── .gitignore ├── EJERCICIO ├── EJERCICIO1_T2_LEON.js └── EJERCICIO2_T2_LEON.c ├── PRIMER_RETO_AURA_CALDERON ├── README.md ├── Semana1 ├── Clase_Lunes.ipynb ├── Reto │ ├── Entregas │ │ ├── Gruposabado_2172116_reto1 │ │ │ ├── Ejercicios_1.pdf │ │ │ └── reto1 │ │ │ │ ├── 1_circulodelradio.py │ │ │ │ ├── 2_nombreapellido_invertido.py │ │ │ │ ├── 3_impresion_extencion_archivo.py │ │ │ │ ├── 4_numero_n_nn_nnn.py │ │ │ │ ├── 5_radioesfera.py │ │ │ │ └── 6_añoquecumplira100.py │ │ ├── LUNES-2200292 │ │ │ ├── Añoactual.py │ │ │ ├── Documento.py │ │ │ ├── Invertir.py │ │ │ ├── Número.py │ │ │ ├── areadelcirculo.py │ │ │ └── volumen.py │ │ ├── Lunes_2200262 │ │ │ ├── BrayanParra_Reto1.pdf │ │ │ ├── Reto1_1AreaCirculo.py │ │ │ ├── Reto1_2NombreInverso.py │ │ │ ├── Reto1_3Extension.py │ │ │ ├── Reto1_4n.py │ │ │ ├── Reto1_5VolumenEsfera.py │ │ │ └── Reto1_6Edad.py │ │ ├── README.md │ │ ├── Reto 1 │ │ │ └── Sabado_2184609 │ │ │ │ ├── Cumpletar_Cien.py │ │ │ │ ├── Extension.py │ │ │ │ ├── Invertir_Nombres.py │ │ │ │ ├── N_NN_NNN_.py │ │ │ │ ├── Radio del circulo.py │ │ │ │ ├── Radio y Volumen_Esfera.py │ │ │ │ └── Reto 1_2184609.docx │ │ ├── Sabado_2192092 │ │ │ ├── Ejercicio_1.py │ │ │ ├── Ejercicio_2.py │ │ │ ├── Ejercicio_3.py │ │ │ ├── Ejercicio_4.py │ │ │ ├── Ejercicio_5.py │ │ │ ├── Ejercicio_6.py │ │ │ └── Ejercicio_7.py │ │ ├── Sábado_2184607 │ │ │ ├── 2184607_RETO 1.docx │ │ │ ├── cumplir_cien.py │ │ │ ├── extensión.py │ │ │ ├── n_nn_nnn_.py │ │ │ ├── nombre_inverso.py │ │ │ ├── radio-circulo.py │ │ │ └── radio_volumen_esfera.py │ │ ├── Sábado_2200269 │ │ │ ├── Area-circulo.py │ │ │ ├── Edad100.py │ │ │ ├── Extensión.py │ │ │ ├── Nombre.py │ │ │ ├── Suma.py │ │ │ └── VolumenEsfera.py │ │ ├── Viernes_2162277 │ │ │ └── Reto_1.py │ │ ├── extension_archivo.py │ │ ├── lunes_2170249 │ │ │ ├── PRIMER_RETO_AURA_CALDERON │ │ │ ├── PRIMER_RETO_MORENO_PABLO_2200292 │ │ │ ├── edad_en_cien.py │ │ │ ├── esfera.py │ │ │ ├── extension_archivo.py │ │ │ ├── invertir_nombre.py │ │ │ ├── n_nn_nnn.py │ │ │ └── radio_circulo.py │ │ ├── lunes_2200299 │ │ │ ├── Documento.py │ │ │ ├── Nombre inverso.py │ │ │ ├── año100.py │ │ │ ├── n + nn + nnn.py │ │ │ ├── volumen.py │ │ │ └── área.py │ │ ├── lunes_2200301 │ │ │ ├── Bacon.py │ │ │ ├── Edad_100.py │ │ │ ├── Nombre_inverso.py │ │ │ ├── area_circulo.py │ │ │ ├── extension.py │ │ │ ├── nnn.py │ │ │ └── volumen.py │ │ └── viernes_2200273 │ │ │ ├── RETO 1 │ │ │ ├── RETO 1.1 │ │ │ ├── RETO 1.2 │ │ │ ├── RETO 1.3 │ │ │ └── RETO 1.4 │ ├── __pycache__ │ │ └── retos.cpython-38.pyc │ ├── modulos.py │ └── retos.py ├── ejemplo1.py └── hello_world.py ├── Semana2 ├── Reto │ ├── Entregas │ │ ├── Gruposabado_2172116_reto2 │ │ │ ├── 11.obtenernumerosyletras.py │ │ │ ├── 12.contraseñas.py │ │ │ ├── 13. patrontipoE.py │ │ │ ├── 14.patronmario.py │ │ │ ├── 15.multiplicaciondebucle.py │ │ │ ├── 1_Iteraryusarcondiciones.py │ │ │ ├── 2_Convertirtemperatura.py │ │ │ ├── 3_Adivinaelnúmero.py │ │ │ ├── 4_Patrón de caracteres.py │ │ │ ├── 5_Invertir palabras.py │ │ │ ├── 6_Pares e impares.py │ │ │ ├── 7_Omitir valores.py │ │ │ ├── 8_Fibonacci.py │ │ │ └── 9.fizzbuzz.py │ │ ├── Lunes_2191437 │ │ │ ├── EJERCICIO_1.py │ │ │ ├── EJERCICIO_11.py │ │ │ ├── EJERCICIO_13.py │ │ │ ├── EJERCICIO_14.py │ │ │ ├── EJERCICIO_2.py │ │ │ ├── EJERCICIO_3.py │ │ │ ├── EJERCICIO_4.py │ │ │ ├── EJERCICIO_5.py │ │ │ ├── EJERCICIO_6.py │ │ │ ├── EJERCICIO_7.py │ │ │ ├── EJERCICIO_8.py │ │ │ └── EJERCICIO_9.py │ │ ├── Lunes_2192097 │ │ │ ├── Nombre_Reves.py │ │ │ ├── Par_impar.py │ │ │ ├── Patron_asterisco.py │ │ │ ├── Tabla_multi.py │ │ │ ├── Temperatura.py │ │ │ └── multiplos.py │ │ ├── Lunes_2200262_Reto2 │ │ │ ├── Lunes_2200262_Reto2 │ │ │ │ ├── Reto2_1Multiplos De5Y7.py │ │ │ │ ├── Reto2_2GradosCyF.py │ │ │ │ ├── Reto2_3AdivinaDigito.py │ │ │ │ ├── Reto2_4ImprimirDe0A6.py │ │ │ │ ├── Reto2_5Fibonacci.py │ │ │ │ ├── Reto2_6TablaDeMultiplicar.py │ │ │ │ ├── Reto2_7Invertir.py │ │ │ │ └── Reto3_1ImprimirImpares.py │ │ │ ├── Reto2_1Multiplos De5Y7.py │ │ │ ├── Reto2_2GradosCyF.py │ │ │ ├── Reto2_3AdivinaDigito.py │ │ │ ├── Reto2_4ImprimirDe0A6.py │ │ │ ├── Reto2_5Fibonacci.py │ │ │ ├── Reto2_6TablaDeMultiplicar.py │ │ │ ├── Reto2_7Invertir.py │ │ │ ├── Reto3_1ExtraerImpares.py │ │ │ └── Reto3_3ApilarMatrices.py │ │ ├── README.md │ │ ├── Reto 2 │ │ │ ├── Sabado_2184609 │ │ │ │ ├── Adivinar_Numeros.py │ │ │ │ ├── Bucles de Mulptiplicaciones.py │ │ │ │ ├── Contar_Binarios_Numeros.py │ │ │ │ ├── Convertir_Temperatura.py │ │ │ │ ├── Fibonacci.py │ │ │ │ ├── FizzBuzz.py │ │ │ │ ├── Invertir las Palabras.py │ │ │ │ ├── Iteracion y uso_Condicionales.py │ │ │ │ ├── Obtener_Numeros y Letras.py │ │ │ │ ├── Obtener_Sugundo_Siguiente.py │ │ │ │ ├── Omitir_Valores.py │ │ │ │ ├── Pares_Impares.py │ │ │ │ ├── Patron E.py │ │ │ │ ├── Patron_Caracteres.py │ │ │ │ ├── Patron_MarioBros.py │ │ │ │ ├── Sofware_Validacion_Contrasenas.py │ │ │ │ └── Valores_Siguientes_Variables.py │ │ │ ├── adivinar.py │ │ │ ├── multiplos.py │ │ │ ├── patron.py │ │ │ ├── segundo.py │ │ │ └── temperatura.py │ │ ├── SEGUNDO_RETO_AURA_CALDERON │ │ ├── SEGUNDO_RETO_MORENO_PABLO_2200292 │ │ ├── Sábado_2184607 │ │ │ ├── adivina_el_numero.py │ │ │ ├── contar_numeros_binarios.py │ │ │ ├── convertir_temperatura.py │ │ │ ├── fibonacci.py │ │ │ ├── fizzbuzz.py │ │ │ ├── invertir_palabras.py │ │ │ ├── iterar_y_usar_condiciones.py │ │ │ ├── multiplicacion_con_bucles.py │ │ │ ├── obtener_el_siguiente_segundo.py │ │ │ ├── obtener_numeros_y_letras.py │ │ │ ├── omitir_valores.py │ │ │ ├── pares_e_impares.py │ │ │ ├── patron_E.py │ │ │ ├── patron_de_caracteres.py │ │ │ ├── patron_mario_bros.py │ │ │ ├── sofware_que_valida_contrasenas.py │ │ │ └── valores_de_las_siguientes_variables.py │ │ ├── Sábado_2200269 │ │ │ ├── Adivina_el_número.py │ │ │ ├── Convertir_temperatura.py │ │ │ ├── Fibonacci.py │ │ │ ├── FizzBuzz.py │ │ │ ├── Invertir_palabras.py │ │ │ ├── Multiplicación.py │ │ │ ├── Obtener_números_letras.py │ │ │ ├── Omitir_valores.py │ │ │ ├── Pares_impares.py │ │ │ └── múltiplos.py │ │ ├── Viernes_2162277 │ │ │ └── Reto_2.py │ │ ├── Viernes_2170255 │ │ │ ├── Adivinar un número.py │ │ │ ├── Convertir temperaturas.py │ │ │ ├── Fibonacci entre 0 y 50.py │ │ │ ├── Invertir palabras.py │ │ │ ├── Mario Bros.py │ │ │ ├── Numero binarios.py │ │ │ ├── Número de dígitos y letras.py │ │ │ ├── Omitir valores.py │ │ │ ├── Pares e impares.py │ │ │ ├── Patrón E.py │ │ │ ├── Patrón de caracteres1.py │ │ │ ├── Tablas de multiplicar.py │ │ │ ├── fizzbuzz.py │ │ │ ├── números que son múltiplos de 5 y 7.py │ │ │ └── validar contraseñas.py │ │ ├── lunes.2200273 │ │ │ ├── RETO 2.1 │ │ │ ├── Reto2_2GradosCyF.py │ │ │ ├── Reto2_3AdivinaDigito (1).py │ │ │ ├── Reto2_4ImprimirDe0A6.py │ │ │ ├── Reto2_5Fibonacci.py │ │ │ ├── Reto2_6TablaDeMultiplicar.py │ │ │ └── Reto2_7Invertir.py │ │ ├── lunes_2182141 │ │ │ ├── Temperatura.py │ │ │ ├── adivinaodr.py │ │ │ ├── binarios.py │ │ │ ├── contraseña.py │ │ │ ├── fiboachi.py │ │ │ ├── fizzbuzz.py │ │ │ ├── invertida_bucle.py │ │ │ ├── mariobross.py │ │ │ ├── multBucles.py │ │ │ ├── multiplos_1.py │ │ │ ├── numLetras.py │ │ │ ├── omitidor.py │ │ │ ├── pares_impares.py │ │ │ ├── patron.py │ │ │ ├── patron2.py │ │ │ ├── reloj.py │ │ │ └── valores.py │ │ └── reto2.py │ └── README.md ├── lunes.2200273 │ ├── RETO 2.1 │ ├── Reto2_2GradosCyF.py │ ├── Reto2_3AdivinaDigito (1).py │ ├── Reto2_4ImprimirDe0A6.py │ ├── Reto2_5Fibonacci.py │ ├── Reto2_6TablaDeMultiplicar.py │ └── Reto2_7Invertir.py ├── numeros_primos.py └── promedio.py ├── Semana3 ├── Automatizar-Excel.ipynb ├── Reto │ ├── Entregas │ │ ├── Gruposabado_2172116_reto3 │ │ │ ├── 10_matriz_cicling.ipynb │ │ │ ├── 11_matriz_segunda.ipynb │ │ │ ├── 12_ultima matriz.ipynb │ │ │ ├── 1_extraccion_pares.ipynb │ │ │ ├── 2_reemplazar_array.ipynb │ │ │ ├── 3_apilar_matrices.ipynb │ │ │ ├── 4_concadenar_matrices.ipynb │ │ │ ├── 5_secuencias.ipynb │ │ │ ├── 6_elementos_comunes.ipynb │ │ │ ├── 7_posiciondeelementos.ipynb │ │ │ └── 8_extracion_rango.ipynb │ │ ├── Lunes_2200262_Reto3 │ │ │ ├── Reto3_1ExtraerNumeros.ipynb.ipynb │ │ │ ├── Reto3_2CambiarElementos.ipynb.ipynb │ │ │ ├── Reto3_3ApilarMatrices.ipynb.ipynb │ │ │ ├── Reto3_4ApilarHorizontal.ipynb.ipynb │ │ │ ├── Reto3_5ElementosComunes.ipynb.ipynb │ │ │ ├── Reto3_6NumerosRango.ipynb.ipynb │ │ │ ├── Reto3_7PosicionesIguaes.ipynb.ipynb │ │ │ └── Reto3_8Secuencia.ipynb.ipynb │ │ ├── README.md │ │ ├── Reto 3 │ │ │ └── Sabado_2184609 │ │ │ │ ├── Apilar_Matrices_Horizontales.py │ │ │ │ ├── Apilar_Matrices_Verticales.py │ │ │ │ ├── Elementos_comunes.py │ │ │ │ ├── Extraer_Elementos_Comunes.py │ │ │ │ ├── Extraer_Elementos_Rango.py │ │ │ │ ├── Generar_Array_Tramos.py │ │ │ │ ├── Posicion_Elementos_Comunes.py │ │ │ │ ├── Reemplazar_Elementos_Array.py │ │ │ │ └── Secuencias.py │ │ ├── Sábado_2184607 │ │ │ ├── apilar_dos_matrices_horizontal.py │ │ │ ├── apilar_dos_matrices_vertical copy.py │ │ │ ├── elementos_comunes.py │ │ │ ├── extraer_elementos_condicion.py │ │ │ ├── extraer_elementos_rango.py │ │ │ ├── generar_array_por_tramos.py │ │ │ ├── posiciones_aquellos_comunes.py │ │ │ ├── reemplazar_elementos_array.py │ │ │ └── secuencias.py │ │ ├── Sábado_2200269 │ │ │ ├── #Elementos_comunes.ipynb │ │ │ ├── Apilar_matrices_horizontalmente.ipynb │ │ │ ├── Apilar_matrices_verticalmente.ipynb │ │ │ ├── Array por tramos.ipynb │ │ │ ├── Elementos comunes.ipynb │ │ │ ├── Elementos_condiciones.ipynb │ │ │ ├── Extraer_elementos_dentro_de_un_rango.ipynb │ │ │ ├── Matrix_slicing_1.ipynb │ │ │ ├── Matrix_slicing_2.ipynb │ │ │ ├── Matrix_slicing_3.ipynb │ │ │ ├── Patrón_de_caracteres.py │ │ │ ├── Reemplazar_elementos_array.ipynb │ │ │ └── Secuencias.ipynb │ │ ├── TERCERO_RETO_AURA_CALDERON │ │ ├── TERCER_RETO_MORENO_PABLO_2200292 │ │ ├── lunes_2182141 │ │ │ ├── apilar.py │ │ │ ├── arrayTramos.py │ │ │ ├── ejer0.py │ │ │ ├── ejer1.py │ │ │ ├── elemComunes.py │ │ │ ├── elementRango.py │ │ │ ├── reemplaz.py │ │ │ ├── secuancias.py │ │ │ ├── silic_1.py │ │ │ └── silic_2.py │ │ └── reto3.py │ ├── Guías │ │ ├── Funciones-Indices-Booleanos.ipynb │ │ ├── Matrices Especiales.ipynb │ │ ├── Operaciones-Básicas.ipynb │ │ └── Slicing_Arrays.ipynb │ ├── README.md │ ├── array.png │ ├── array2.png │ └── array3.png ├── armadura.py ├── bucle_for.py ├── ecuaciones.py ├── horarios.xlsx ├── mbox-short.txt ├── sabado.py └── viernes.py ├── Semana4 ├── Clase_Sábado.ipynb ├── Código_Clase_1.ipynb ├── Deformación_Armadura.ipynb ├── Reto │ ├── Entregas │ │ ├── README.md │ │ └── Sábado_2200269 │ │ │ └── Reto 4.ipynb │ ├── Guías │ │ ├── Clase_Sábado.ipynb │ │ ├── Deformación_Armadura.ipynb │ │ ├── Matplotlib-1-Plots.ipynb │ │ ├── Matplotlib-2-Gráficos-De-Barras.ipynb │ │ ├── Matplotlib-3-Stackplots.ipynb │ │ ├── Matplotlib-4-Fill-Between.ipynb │ │ ├── Matplotlib-5-Histograms.ipynb │ │ ├── Matplotlib-6-Scatter.ipynb │ │ ├── Matplotlib-7-Subplots.ipynb │ │ ├── Matplotlib-8-Advanced-Plotting.ipynb │ │ ├── ages.csv │ │ ├── colors.png │ │ ├── data.csv │ │ ├── lines.png │ │ ├── markers.png │ │ ├── salaries.csv │ │ └── youtube_data.csv │ ├── README.md │ └── viga.png ├── lunes.py └── viga.png ├── Semana5 ├── Clase_Lunes.ipynb ├── Clase_Sabado.ipynb ├── Reto │ ├── Entregas │ │ ├── README.md │ │ ├── T2_2170255_Espejo_Maria.py │ │ └── T2_Brayan_Parra.ipynb │ ├── Guías │ │ ├── Sympy.ipynb │ │ └── Vigas.ipynb │ └── README.md ├── Taller │ ├── Ejercicio_1.ipynb │ ├── Ejercicio_2.ipynb │ ├── Primera_Entrega │ │ ├── Correcion_T1_Ejercicio_1 │ │ │ └── T1_Ejercicio_1 (1).ipynb │ │ ├── T1_2162277_Rojas_Emmanuel.py │ │ ├── T1_2170255_Espejo_Maria.py │ │ ├── T1_2170255_Espejo_Maria │ │ │ ├── T1_2184025_Beleño_Nicole │ │ │ │ └── T1_ejercicio1.ipynb │ │ │ └── T1_Ejercicio1.py │ │ ├── T1_2170255_Rojas_Emmanuel.py │ │ ├── T1_2172116_RINCON_JUAN │ │ │ ├── T1_ejercicio1.ipynb │ │ │ ├── T1_ejercicio2.ipynb │ │ │ ├── Untitled.ipynb │ │ │ └── Untitled1.ipynb │ │ ├── T1_2182141_RAMOS_CARLOS.py │ │ │ ├── T1_ejercicio1.ipynb │ │ │ ├── T1_ejercicio1.py │ │ │ └── T1_ejercicio2.ipynb │ │ ├── T1_2182737_Parra_Sebastian │ │ │ └── T1_ejercicio1.ipynb │ │ ├── T1_2184002_Avendaño_JuanManuel │ │ │ └── T1_ejercicio1.ipynb │ │ ├── T1_2184609_Vides_Karen_Yuset │ │ │ └── T1_ejercicio1.ipynb │ │ ├── T1_2190168_Acevedo_Natalia │ │ │ └── T1_ejercicio1.ipynb │ │ ├── T1_2190184_CARVAJAL_CRISTIAN │ │ │ ├── T1_ejercicio1.ipynb │ │ │ └── T1_ejercicio2.ipynb │ │ ├── T1_2191437_Amaya_Ana │ │ │ └── T1_ejercicio1.ipynb │ │ ├── T1_2192054_RODRIGUEZ_OCTAVIO │ │ │ └── Ejercicio1.py │ │ ├── T1_2194032_Rico_Maria │ │ │ └── T1_ejercicio2.py │ │ ├── T1_2194039_Leon_Deisy │ │ │ ├── T1_ejercicio1.py │ │ │ └── T1_ejercicio2.py │ │ ├── T1_2194042_Pabon_Omar │ │ │ ├── T1_Ejercicio1.py │ │ │ └── T2_Ejercicio2.py │ │ ├── T1_2194518_ORTIZ_JOSE │ │ │ ├── T1_ejercicio1.ipynb │ │ │ └── T1_ejercicio2.ipynb │ │ ├── T1_2195509_RODRIGUEZ_DIANAÇ │ │ │ ├── EJERCICIO 1 DIANA RODRIGUEZ 2195509.ipynb │ │ │ └── EJERCICIO 2 DIANA RODRIGUEZ 2195509.ipynb │ │ ├── T1_2195566_NIÑO_YUDI │ │ │ ├── E_1.ipynb │ │ │ └── E_2.ipynb │ │ ├── T1_2200259_Tapias_Lina │ │ │ ├── T1_ejercicio1.ipynb │ │ │ └── T1_ejercicio2.ipynb │ │ ├── T1_2200262_Parra_Brayan │ │ │ └── T1_Ejercicio1.ipynb │ │ ├── T1_2200269_Rodríguez_Jonatan │ │ │ ├── T1_Ejercicio1.ipynb │ │ │ └── T2_Ejercicio2.ipynb │ │ ├── T1_2200292_MORENO_PABLO.py │ │ ├── T1_2200292_MORENO_PABLO │ │ │ ├── T1_2200292_MORENO_PABLO.py │ │ │ └── T1_EJERCICIO_2.ipynb │ │ ├── T1_2200299_Moncada_Jackson │ │ │ └── T1_ejercicio1.py │ │ ├── T1_2201861_Oñate_Francisco │ │ │ ├── T1_ejercicio1.ipynb │ │ │ └── T1_ejercicio2.ipynb │ │ ├── T1_2201918_Antolinez_Leider │ │ │ ├── T1_ejercicio1.ipynb │ │ │ └── T1_ejercicio2.ipynb │ │ ├── T1_Corrección_2184607_Gonzalez_Fernanda │ │ │ └── T_Ejercicio1_Corrección.ipynb │ │ ├── T1_Ejercicio1.ipynb │ │ ├── T1_ejercicio1.ipynb │ │ ├── T1_ejercicio2.ipynb │ │ ├── T2_2194032_Maria_Rico │ │ └── “T1_2184607_Gonzalez_Fernanda” │ │ │ └── T1_ejercicio1.ipynb │ ├── Segunda_Entrega │ │ └── T1_2200299_ Moncada_Jackson │ │ │ ├── T1_ejercicio1.py │ │ │ └── T1_ejercicio2.py │ └── T1_Santiago_Sanche │ │ ├── T1_SANCHEZ_SANTIAGO.py │ │ └── T2_SANCHEZ_SANTIAGO.py └── taller entrega 2 │ ├── eje2.paula.gonzalez.ipynb │ └── ejer1.paulagonzalez.ipynb ├── Semana6 ├── Clase_Sabado_Excel.ipynb ├── Reto │ ├── Entregas │ │ ├── README.md │ │ ├── T2_2162277_Rojas_Emmanuel.py │ │ ├── T2_2172116_Codigo_Rincon_Juan │ │ │ ├── T2.xlsx │ │ │ └── T2_Solucion.ipynb │ │ └── Taller2_Solucion │ │ │ └── T2_Aura_Calderon.ipynb │ ├── Guías │ │ ├── Excel.ipynb │ │ ├── Pandas-1.ipynb │ │ ├── Pandas-10-Formats.ipynb │ │ ├── Pandas-2-Dataframes.ipynb │ │ ├── Pandas-3-Indexes.ipynb │ │ ├── Pandas-4-Filtering.ipynb │ │ ├── Pandas-5-Updating.ipynb │ │ ├── Pandas-6-Add-Remove.ipynb │ │ ├── Pandas-7-Sorting-Data.ipynb │ │ ├── Pandas-8-Grouping-Data.ipynb │ │ ├── Pandas-9-CleaningData.ipynb │ │ ├── data.csv │ │ └── survey_results_schema.csv │ └── README.md └── T2.xlsx ├── Semana7 ├── Clase_Lunes_Graphs.ipynb ├── Clase_Sabado_Graphs.ipynb ├── Reto │ ├── Entregas │ │ ├── README.md │ │ └── T2_SantiagoSanchez_2200307 │ │ │ └── T2_SantiagoSanchez.ipynb │ └── README.md ├── T2.xlsx ├── perfil1.png ├── perfil2.png ├── resultado.png └── viga.png ├── Semana8 ├── Clase_Lunes.ipynb ├── Clase_Sabado.ipynb ├── Reto │ ├── Entregas │ │ └── README.md │ └── README.md ├── Tres_Dimensiones.ipynb └── ejercicio.png ├── Semana9 ├── Clase_Cortante.ipynb ├── Más alto │ └── Segunda_Entrega │ │ └── T2_2194028_Alfonso_Nicolas ├── Primera_Entrega │ └── T2_2200269_Rodríguez_Jonatan │ │ ├── T2_solucion.ipynb │ │ └── Taller2.xlsx ├── T2_2162277_Rojas_Emmanuel │ ├── ExcelTaller2.xlsx │ └── T2_2162277_Rojas_Emmanuel.py ├── Taller │ ├── Primera_Entrega │ │ ├── README.md │ │ ├── T2_2170249_Apellido_Nombre │ │ │ ├── Clase_Cortante.ipynb │ │ │ └── cortante.xlsx │ │ ├── T2_2184025_Beleño_Nicole │ │ │ ├── T2_Ejercicio1.ipynb │ │ │ └── T2_Ejercicio2.ipynb │ │ ├── T2_2200259_Tapias_Lina │ │ │ └── Untitled-.ipynb │ │ └── T2_2201861_Oñate_Francisco │ │ │ ├── T2.xlsx │ │ │ └── Untitled.ipynb │ ├── README.md │ └── Segunda_Entrega │ │ ├── README.md │ │ ├── T2_2170255_Espejo_Maria │ │ ├── ExcelTaller2.xlsx │ │ └── T2_2170255_Espejo_Maria.py │ │ ├── T2_2182737_Parra_Sebastian │ │ └── T2_solucion.ipynb │ │ ├── T2_2184002_Avendaño_JuanManuel │ │ ├── T2.xlsx │ │ ├── T2_Ejercicio1.ipynb │ │ └── T2_Ejercicio2.ipynb │ │ ├── T2_2184025_Beleño_Nicole │ │ ├── T2.xlsx │ │ ├── T2_Ejercicio1.ipynb │ │ └── T2_Ejercicio2.ipynb │ │ ├── T2_2190184_CARVAJAL_CRISTIAN │ │ ├── T2.pdf │ │ ├── T2.xlsx │ │ └── T2_solucion.ipynb │ │ ├── T2_2191437_Amaya_Ana │ │ └── T2_E1.ipynb │ │ ├── T2_2194034_Barajas_Sarai │ │ ├── T2_2194042_Pabon_Omar │ │ ├── T2_EJERCICIO1.js │ │ └── T2_EJERCICIO2.c │ │ ├── T2_2194518_Ortiz Jose │ │ └── T2.xlsx │ │ ├── T2_2195566_ÑIÑO_YUDI │ │ ├── E1.ipynb │ │ ├── E2.ipynb │ │ └── T2.xlsx │ │ ├── T2_2200299_Moncada_Jackson │ │ ├── T2_Ejercicio1.ipynb │ │ ├── T2_Ejercicio2.ipynb │ │ ├── “T2_2184607_Gonzalez_Fernanda │ │ └── T2_ejercicio 1.ipynb │ │ └── “T2_2184609_Vides_Karen │ │ └── T2_Ejercicio1.ipynb ├── cortante.xlsx ├── cortante1.png ├── cortante2.png └── t2_2200273 │ └── tallerpaulagonzalez.ipynb ├── extensions.txt └── semana 9 /PRIMER_RETO_AURA_CALDERON: -------------------------------------------------------------------------------- 1 | print("Vamos a calcular el área de un círculo") 2 | radio = float(input("Ingrese el radio del círculo ")) 3 | pi=3.1416 4 | area = pi*radio**2 5 | print(f"El radio del círculo es aproximadamente : {area}") 6 | 7 | print("Vamos a leer tu nombre al revés") 8 | nombre = input("Ingresa tu nombre completo") 9 | print((nombre[::-1])) 10 | 11 | print("Vamos a descubrir cuándo cumplirás 100 años") 12 | nombre = input("Ingresa tu nombre ") 13 | edad = input("Ingresa tu edad ") 14 | cuando_cumpla_100_años = 2121-int(edad) 15 | print(f"Cumplirás 100 años en {cuando_cumpla_100_años}") 16 | 17 | print("Vamos a calcular el volumen de una esfera") 18 | radio = float(input("Inserta el radio de la esfera ")) 19 | pi = 3.1416 20 | volumen = (4/3)*pi*radio**3 21 | print(f"El volumen de la esfera es proximadamente: {volumen}") 22 | 23 | print("Vamos a sumar un número de una manera diferente") 24 | n = (input("Ingrese un número ")) 25 | nn = str(n+n) 26 | nnn = str(n+n+n) 27 | suma = int(n)+int(nn)+int(nnn) 28 | print(f"El resultado de la suma es {suma}") 29 | 30 | print("Vamos a descubrir en qué extensión tienes un archivo") 31 | nombre = input("Ingresa el nombre de tu documento ") 32 | lista=nombre.split(".") 33 | print(lista[1]) 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Python-Coding-Lab 2 | 3 | This is the place where we will have our code for the course. You can download it and practice! 4 | 5 | ## Installing Visual Studio Code extensions 6 | 7 | Execute the corresponding commands in your command line in order to install VS Code extensions: 8 | 9 | - Windows: 10 | > $files = Get-Content -Path extensions.txt 11 | 12 | > ForEach ($file in $files) { code --install-extension $file } 13 | - Mac: 14 | > cat extensions.txt | xargs -L 1 code --install-extension 15 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Gruposabado_2172116_reto1/Ejercicios_1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana1/Reto/Entregas/Gruposabado_2172116_reto1/Ejercicios_1.pdf -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Gruposabado_2172116_reto1/reto1/1_circulodelradio.py: -------------------------------------------------------------------------------- 1 | ## se define el parametro pi 2 | from math import pi 3 | ## se define la variable del radio 4 | r = float(input("input el radio del circulo")) 5 | ## se imprime el resultado del area generando la operacion del radio para un circulo 6 | print("el area del circculo con radio de " + str(r) + " es = " + str(pi * r **2)) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Gruposabado_2172116_reto1/reto1/2_nombreapellido_invertido.py: -------------------------------------------------------------------------------- 1 | ## se define la variable del nombre 2 | nombre = input("su nombre : ") 3 | ## se define la variable del apellido 4 | apellido = input("su apellido : ") 5 | ## se genera una linea de codigo que invertira el orden de las letras de las variable definidas 6 | print("hola " + apellido[::-1] + " " + nombre[::-1]) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Gruposabado_2172116_reto1/reto1/3_impresion_extencion_archivo.py: -------------------------------------------------------------------------------- 1 | ## 2 | nombrearchivo = input("EL nombre del archivo es: ") 3 | ## 4 | extencion = nombrearchivo.split(".") 5 | ## 6 | print("La extension del archivo es: " + repr(extencion[-1])) 7 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Gruposabado_2172116_reto1/reto1/4_numero_n_nn_nnn.py: -------------------------------------------------------------------------------- 1 | ## 2 | c = input("numero : ") 3 | ## 4 | n1 = int(c) 5 | n2 = int(str(c) + str(c)) 6 | n3 = int(c + c + c) 7 | ## 8 | print(n1 + n2 + n3) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Gruposabado_2172116_reto1/reto1/5_radioesfera.py: -------------------------------------------------------------------------------- 1 | ## 2 | from math import pi 3 | ## 4 | r = int(input("Ingrese el radio de la esfera: ")) 5 | ## 6 | v = 4 / 3 * pi * r ** 3 7 | ## 8 | print("El volumen de la esfera es: ", v) 9 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Gruposabado_2172116_reto1/reto1/6_añoquecumplira100.py: -------------------------------------------------------------------------------- 1 | ## 2 | nombre = input("cual es su nombre: ") 3 | ## 4 | edad = int(input("cual es su edad: ")) 5 | ## 6 | año = str((2022 - edad) + 100) 7 | ## 8 | print(nombre + " " + "usted cumplira cien años en el año " + año) 9 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/LUNES-2200292/Añoactual.py: -------------------------------------------------------------------------------- 1 | nombre = input('nombre: ') 2 | 3 | edad = int(input('edad: ')) 4 | 5 | año = 2022 + (100 - edad) 6 | 7 | print(nombre, "a tus 100 años el año presente será" + str(año)) 8 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/LUNES-2200292/Documento.py: -------------------------------------------------------------------------------- 1 | document = input('documento: ') 2 | 3 | espacio = document.split(".") 4 | 5 | mayuscula = espacio[1] 6 | 7 | resultado = mayuscula.capitalize() 8 | 9 | print('el tipo es:', resultado) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/LUNES-2200292/Invertir.py: -------------------------------------------------------------------------------- 1 | name = input('nombre: ') 2 | 3 | last_name = input('apellido: ') 4 | 5 | nl = name + ' ' + last_name 6 | 7 | print((nl[::-1])) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/LUNES-2200292/Número.py: -------------------------------------------------------------------------------- 1 | n = str(input('Numero: ')) 2 | n2 = (n+n) 3 | n3 =(n+n+n) 4 | resultado = int(n) + int(n2) + int(n3) 5 | print(str(resultado)) 6 | 7 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/LUNES-2200292/areadelcirculo.py: -------------------------------------------------------------------------------- 1 | from math import pi 2 | 3 | radio = int(input('Radio: ')) 4 | 5 | a = pi * (radio**2) 6 | 7 | print('el área es: ' + str(a )) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/LUNES-2200292/volumen.py: -------------------------------------------------------------------------------- 1 | 2 | from math import pi 3 | 4 | r = int(input('radio: ')) 5 | 6 | v = (4/3) * pi * (r**3) 7 | 8 | print(str(v)) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Lunes_2200262/BrayanParra_Reto1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana1/Reto/Entregas/Lunes_2200262/BrayanParra_Reto1.pdf -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Lunes_2200262/Reto1_1AreaCirculo.py: -------------------------------------------------------------------------------- 1 | print("Vamos a calcular el área de un círculo") 2 | radio = float(input("Ingrese el radio del círculo ")) 3 | pi=3.1416 4 | area = pi*radio**2 5 | print(f"El radio del círculo es aproximadamente : {area}") 6 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Lunes_2200262/Reto1_2NombreInverso.py: -------------------------------------------------------------------------------- 1 | print("Vamos a leer tu nombre al revés") 2 | nombre = input("Ingresa tu nombre completo") 3 | print((nombre[::-1])) 4 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Lunes_2200262/Reto1_3Extension.py: -------------------------------------------------------------------------------- 1 | print("Vamos a descubrir en qué extensión tienes un archivo") 2 | nombre = input("Ingresa el nombre de tu documento ") 3 | lista=nombre.split(".") 4 | print(lista[1]) 5 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Lunes_2200262/Reto1_4n.py: -------------------------------------------------------------------------------- 1 | print("Vamos a sumar un número de una manera diferente") 2 | n = (input("Ingrese un número ")) 3 | nn = str(n+n) 4 | nnn = str(n+n+n) 5 | suma = int(n)+int(nn)+int(nnn) 6 | print(f"El resultado de la suma es {suma}") 7 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Lunes_2200262/Reto1_5VolumenEsfera.py: -------------------------------------------------------------------------------- 1 | print("Vamos a calcular el volumen de una esfera") 2 | radio = float(input("Inserta el radio de la esfera ")) 3 | pi = 3.1416 4 | volumen = (4/3)*pi*radio**3 5 | print(f"El volumen de la esfera es proximadamente: {volumen}") 6 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Lunes_2200262/Reto1_6Edad.py: -------------------------------------------------------------------------------- 1 | print("Vamos a descubrir cuándo cumplirás 100 años") 2 | nombre = input("Ingresa tu nombre ") 3 | edad = input("Ingresa tu edad ") 4 | cuando_cumpla_100_años = 2121-int(edad) 5 | print(f"Cumplirás 100 años en {cuando_cumpla_100_años}") 6 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/README.md: -------------------------------------------------------------------------------- 1 | # Carpeta de entregas de la Semana 1 2 | 3 | Acá es donde debe subir la carpeta con sus retos según lo indicado en el vídeo del [acá en el aula virtual](https://drive.google.com/file/d/1rY_XUXCMwqY3chPxq7QMhZSd6tIs5pBd/view?usp=sharing) 4 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Reto 1/Sabado_2184609/Cumpletar_Cien.py: -------------------------------------------------------------------------------- 1 | name = input("¿Cúal es tu nombre?: ") 2 | age = int(input("¿Cuántos años tienes?: ")) 3 | year = str((2021 - age) + 100) 4 | print(name + " Vas a tener 100 años en el año " + year) 5 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Reto 1/Sabado_2184609/Extension.py: -------------------------------------------------------------------------------- 1 | filename = input("Escriba el nombre del archivo: ") 2 | f_extns = filename.split(".") 3 | print("La extensión del archivo es : " + repr(f_extns[-1])) 4 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Reto 1/Sabado_2184609/Invertir_Nombres.py: -------------------------------------------------------------------------------- 1 | fname = input("Escribe tu nombre : ") 2 | lname = input("Escribe tu apellido : ") 3 | print("Hola " + lname[::-1] + " " + fname[::-1]) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Reto 1/Sabado_2184609/N_NN_NNN_.py: -------------------------------------------------------------------------------- 1 | a = input("Escribe un integer : ") 2 | n1 = int(a) 3 | n2 = int(a + a) 4 | n3 = int(a + a + a) 5 | print(n1 + n2 + n3) 6 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Reto 1/Sabado_2184609/Radio del circulo.py: -------------------------------------------------------------------------------- 1 | from math import pi 2 | 3 | r = float(input("Escriba el radio del círculo : ")) 4 | 5 | print("El área del círculo con radio igual a " + str(r) + " es: " + str(pi * r ** 2)) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Reto 1/Sabado_2184609/Radio y Volumen_Esfera.py: -------------------------------------------------------------------------------- 1 | from math import pi 2 | 3 | radio = int(input("Ingrese el radio de la esfera: ")) 4 | V = 4.0 / 3.0 * pi * radio ** 3 5 | print("El volumen de la esfera es: ", V) 6 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Reto 1/Sabado_2184609/Reto 1_2184609.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana1/Reto/Entregas/Reto 1/Sabado_2184609/Reto 1_2184609.docx -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sabado_2192092/Ejercicio_1.py: -------------------------------------------------------------------------------- 1 | # NECESITO LA EDAD DEL USUARIO PARA PRODUCIR LA EDAD QUE TENDRÁ EL SIGUIENTE AÑO 2 | 3 | # INPUT: Edad de la persona? restricciones: edad >0 4 | 5 | #1.Pedir la edad del usuario 6 | 7 | while True: 8 | try: 9 | edad_del_usuario= int(input("ingrese su edad: ")) 10 | if edad_del_usuario > 0: 11 | break 12 | else: 13 | print("Ingrese una edad valida") 14 | except: 15 | print("Ingrese una edad valida") 16 | # 2. Calcular la edad del usuario en el siguiente año (edad + 1) 17 | edad_mas_uno = edad_del_usuario + 1 18 | # 3. Mostrar el resultado al usuario 19 | 20 | print("su edad será: " + str(edad_mas_uno)) 21 | #print(edad mas uno) 22 | #OUTPUT: Edad de la persona + 1 -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sabado_2192092/Ejercicio_2.py: -------------------------------------------------------------------------------- 1 | #Escriba un programa de Python que pida el radio del circulo de un usuario 2 | # y muestre su área como salida. 3 | #1. Se importan las librerias de matematematicas 4 | import math 5 | #2. Se íde el radio al usuario 6 | radio=(float(input("Ingrese el radio: "))) 7 | #3. Se realiza la opereación para hallar el área 8 | Area=math.pi*pow(radio,2) 9 | #4. Se imptrime el resultado del área del circulo 10 | print("El area del circulo es: " + str(Area)) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sabado_2192092/Ejercicio_3.py: -------------------------------------------------------------------------------- 1 | #Escriba un programa que acepte el nombre y apellido del usuario y los imprima en orden inverso, 2 | # con un espacio entre ellos 3 | #1. Se pide al usuario que ingrese su nombre y apellido 4 | nombre=input("Ingrese su nombre y apellido: ") 5 | #2. Se imprime el nombre inverso del usuario 6 | print("Su Nombre al revés es: " + nombre[::-1]) 7 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sabado_2192092/Ejercicio_4.py: -------------------------------------------------------------------------------- 1 | #Escriba un programa que acepte el nombre de un archivo por parte del usuario e imprima su extensión 2 | #1. Se pide al usuario que ingrese el tipo de documento 3 | Doc=input("ingrese el tipo de documento:") 4 | #2. Se utiliza la funcción split para devoler una lista de cadenas 5 | Doc=Doc.split('.') 6 | #3. En el paso anterior se separan las palabras y se imprime la ultima palabra de la expresión 7 | #que corresponde a la extensión del archivo. 8 | print((Doc[-1])) 9 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sabado_2192092/Ejercicio_5.py: -------------------------------------------------------------------------------- 1 | #➢ Desarrolle un software que reciba un número n (integer) y dé como resultado el valor n 2 | #+ nn + nnn 3 | #1. Se pide al usuario un numero n 4 | n=int(input("Ingrese un numero n: ")) 5 | #2. Se realiza la respectiva operación 6 | Resultado=n+n*n+n*n*n 7 | #3. Se imprime el resultado de la opereación solicitada 8 | print("El resultador de la operación de n+ nn + nnn, es:",Resultado) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sabado_2192092/Ejercicio_6.py: -------------------------------------------------------------------------------- 1 | #➢ Escriba un programa de Python que pida el radio de una esfera y calcule su volumen. 2 | import math 3 | #1. Solicitar al usuario que ingrese el radio de la esfera 4 | r=int(input("Ingrese el radio de la esfera: ")) 5 | #2. Calcular el volumen de una esfera 6 | Vol=4/3*math.pi*pow(r,3) 7 | #3. Imprimir el resultado del área de la esfera 8 | print("El volumen de la esfera de radio: " + str(r)+ " es: " + str(Vol)) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sabado_2192092/Ejercicio_7.py: -------------------------------------------------------------------------------- 1 | #Desarrolle un software que pida al usuario su nombre y su edad. Mostrar un mensaje que le diga a esa 2 | # persona el año en el que va a cumplir 100 años 3 | #1. Se pide al usuario que ingrese el nombre, la edad y el año actual en el que se encuentr 4 | nombre=input("Ingrese su nombre: ") 5 | edad=int(input("Ingrese su edad: ")) 6 | año=int(input("Ingrese el año actual en el que se encuentra: ")) 7 | 8 | A=100-edad 9 | Añof=A+año 10 | print(nombre + " en " + str(Añof) + " cumplirá 100 años") 11 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sábado_2184607/2184607_RETO 1.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana1/Reto/Entregas/Sábado_2184607/2184607_RETO 1.docx -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sábado_2184607/cumplir_cien.py: -------------------------------------------------------------------------------- 1 | name = input("¿Cúal es tu nombre?: ") 2 | age = int(input("¿Cuántos años tienes?: ")) 3 | year = str((2021 - age) + 100) 4 | print(name + " Vas a tener 100 años en el año " + year) 5 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sábado_2184607/extensión.py: -------------------------------------------------------------------------------- 1 | filename = input("Escriba el nombre del archivo: ") 2 | f_extns = filename.split(".") 3 | print("La extensión del archivo es : " + repr(f_extns[-1])) 4 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sábado_2184607/n_nn_nnn_.py: -------------------------------------------------------------------------------- 1 | a = input("Escribe un integer : ") 2 | n1 = int(a) 3 | n2 = int(a + a) 4 | n3 = int(a + a + a) 5 | print(n1 + n2 + n3) 6 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sábado_2184607/nombre_inverso.py: -------------------------------------------------------------------------------- 1 | fname = input("Escribe tu nombre : ") 2 | lname = input("Escribe tu apellido : ") 3 | print("Hola " + lname[::-1] + " " + fname[::-1]) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sábado_2184607/radio-circulo.py: -------------------------------------------------------------------------------- 1 | from math import pi 2 | 3 | r = float(input("Escriba el radio del círculo : ")) 4 | 5 | print("El área del círculo con radio igual a " + str(r) + " es: " + str(pi * r ** 2)) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sábado_2184607/radio_volumen_esfera.py: -------------------------------------------------------------------------------- 1 | from math import pi 2 | 3 | radio = int(input("Ingrese el radio de la esfera: ")) 4 | V = 4.0 / 3.0 * pi * radio ** 3 5 | print("El volumen de la esfera es: ", V) 6 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sábado_2200269/Area-circulo.py: -------------------------------------------------------------------------------- 1 | Radio = float(input("INSERTE RADIO EN CM: ")) 2 | from math import pi 3 | Area = pi*Radio**2 4 | print("ÁREA DEL CIRCULO:",Area) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sábado_2200269/Edad100.py: -------------------------------------------------------------------------------- 1 | Nombre = input("NOMBRE COMPLETO: ") 2 | Edad = input("EDAD: ") 3 | NE = 2021-int(Edad)+100 4 | print(Nombre,"Usted cumplirá 100 años en",NE) 5 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sábado_2200269/Extensión.py: -------------------------------------------------------------------------------- 1 | Documento = input("INSERTE NOMBRE DOCUMENTO:") 2 | Lista = Documento.split() 3 | print("EXTENSIÓN:",Lista[1]) 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sábado_2200269/Nombre.py: -------------------------------------------------------------------------------- 1 | Nombre = input("INSERTE SU NOMBRE: ") 2 | Apellido = input("INSERTE SU APELLIDO: ") 3 | 4 | nombre = "" 5 | for i in Nombre: 6 | nombre = i + nombre 7 | 8 | apellido = "" 9 | for u in Apellido: 10 | apellido = u + apellido 11 | 12 | NA = nombre +" "+ apellido 13 | print("NOMBRE COMPLETO AL REVÉS", NA) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sábado_2200269/Suma.py: -------------------------------------------------------------------------------- 1 | Número = input("INSERTE NÚMERO ENTERO:") 2 | 3 | termino1 = int(Número) 4 | termino2 = int(Número*2) 5 | termino3 =int(Número*3) 6 | 7 | suma = termino1 + termino2 + termino3 8 | print("RESULTADO:",suma) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Sábado_2200269/VolumenEsfera.py: -------------------------------------------------------------------------------- 1 | Radio = float(input("INSERTE RADIO EN CM: ")) 2 | from math import pi 3 | Volumen = 4/3*pi*Radio**3 4 | print("VOLUMEN ESFERA:",Volumen) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/Viernes_2162277/Reto_1.py: -------------------------------------------------------------------------------- 1 | #EJERCICIO 1: RADIO DEL CILCULO 2 | radio1=float(input("Inserte el radio: ")) 3 | import math 4 | pi=math.pi 5 | area=pi*radio1**2 6 | print("El area del circulo es: "+str(area)) 7 | 8 | #EJERCICIO 2: NOMBRE INVERTIDO 9 | nombre1=input("Inserte su nombre por favor: ") 10 | apellido1=input("Inserte su apellido por favor: ") 11 | resultado=(apellido1[::-1]+" "+nombre1[::-1]) 12 | print("Resultado: "+resultado) 13 | 14 | #EJERCICIO 3: FORMATO DEL DOCUMENTO 15 | nombre_doc=input("Ingrese el nombre de su documento: ") 16 | formato=(nombre_doc[-4:]) 17 | print("El formato de su documento es: "+formato.capitalize()) 18 | 19 | #EJERCICIO 4: NUMERO n 20 | 21 | 22 | 23 | 24 | #EJERCICIO 5: VOLUMEN DE UNA ESFERA 25 | radio2=float(input("Ingrese el radio de la esfera: ")) 26 | vol=pi*(4/3)*radio2**3 27 | print("El volumen de su esfera es: "+str(vol)) 28 | 29 | #EJERCICIO 6: CUANDO CUMPLIRA 100 AÑOS 30 | nombre2=input("Ingrese su nombre: ") 31 | edad1=int(input("Ingrese su edad: ")) 32 | sol=100-edad1+2021 33 | print(nombre2+" usted cumplira 100 años en el año "+str(sol)) 34 | 35 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/extension_archivo.py: -------------------------------------------------------------------------------- 1 | filename = input("Input the Filename: ") 2 | f_extns = filename.split(".") 3 | print("The extension of the file is : " + repr(f_extns[-1])) 4 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2170249/PRIMER_RETO_AURA_CALDERON: -------------------------------------------------------------------------------- 1 | print("Vamos a calcular el volumen de una esfera") 2 | radio = float(input("Inserta el radio de la esfera ")) 3 | pi = 3.1416 4 | volumen = (4/3)*pi*radio**3 5 | print(f"El volumen de la esfera es proximadamente: {volumen}") 6 | 7 | print("Vamos a sumar un número de una manera diferente") 8 | n = (input("Ingrese un número ")) 9 | nn = str(n+n) 10 | nnn = str(n+n+n) 11 | suma = int(n)+int(nn)+int(nnn) 12 | print(f"El resultado de la suma es {suma}") 13 | 14 | print("Vamos a descubrir en qué extensión tienes un archivo") 15 | nombre = input("Ingresa el nombre de tu documento ") 16 | lista=nombre.split(".") 17 | print(lista[1]) 18 | 19 | print("Vamos a calcular el área de un círculo") 20 | radio = float(input("Ingrese el radio del círculo ")) 21 | pi=3.1416 22 | area = pi*radio**2 23 | print(f"El radio del círculo es aproximadamente : {area}") 24 | 25 | print("Vamos a leer tu nombre al revés") 26 | nombre = input("Ingresa tu nombre completo") 27 | print((nombre[::-1])) 28 | 29 | print("Vamos a descubrir cuándo cumplirás 100 años") 30 | nombre = input("Ingresa tu nombre ") 31 | edad = input("Ingresa tu edad ") 32 | cuando_cumpla_100_años = 2121-int(edad) 33 | print(f"Cumplirás 100 años en {cuando_cumpla_100_años}") 34 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2170249/PRIMER_RETO_MORENO_PABLO_2200292: -------------------------------------------------------------------------------- 1 | print("Vamos a descubrir cuándo cumplirás 100 años") 2 | nombre = input("Ingresa tu nombre ") 3 | edad = input("Ingresa tu edad ") 4 | cuando_cumpla_100_años = 2121-int(edad) 5 | print(f"Cumplirás 100 años en {cuando_cumpla_100_años}") 6 | 7 | print("Vamos a calcular el volumen de una esfera") 8 | radio = float(input("Inserta el radio de la esfera ")) 9 | pi = 3.1416 10 | volumen = (4/3)*pi*radio**3 11 | print(f"El volumen de la esfera es proximadamente: {volumen}") 12 | 13 | print("Vamos a sumar un número de una manera diferente") 14 | n = (input("Ingrese un número ")) 15 | nn = str(n+n) 16 | nnn = str(n+n+n) 17 | suma = int(n)+int(nn)+int(nnn) 18 | print(f"El resultado de la suma es {suma}") 19 | 20 | print("Vamos a descubrir en qué extensión tienes un archivo") 21 | nombre = input("Ingresa el nombre de tu documento ") 22 | lista=nombre.split(".") 23 | print(lista[1]) 24 | 25 | print("Vamos a calcular el área de un círculo") 26 | radio = float(input("Ingrese el radio del círculo ")) 27 | pi=3.1416 28 | area = pi*radio**2 29 | print(f"El radio del círculo es aproximadamente : {area}") 30 | 31 | print("Vamos a leer tu nombre al revés") 32 | nombre = input("Ingresa tu nombre completo") 33 | print((nombre[::-1])) 34 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2170249/edad_en_cien.py: -------------------------------------------------------------------------------- 1 | name = input("What is your name: ") 2 | age = int(input("How old are you: ")) 3 | year = str((2021 - age) + 100) 4 | print(name + " will be 100 years old in the year " + year) 5 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2170249/esfera.py: -------------------------------------------------------------------------------- 1 | from math import pi 2 | 3 | radio = int(input("Ingrese el radio de la esfera: ")) 4 | V = 4.0 / 3.0 * pi * radio ** 3 5 | print("The volume of the sphere is: ", V) 6 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2170249/extension_archivo.py: -------------------------------------------------------------------------------- 1 | filename = input("Input the Filename: ") 2 | f_extns = filename.split(".") 3 | print("The extension of the file is : " + repr(f_extns[-1])) 4 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2170249/invertir_nombre.py: -------------------------------------------------------------------------------- 1 | fname = input("Input your First Name : ") 2 | lname = input("Input your Last Name : ") 3 | print("Hello " + lname[::-1] + " " + fname[::-1]) 4 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2170249/n_nn_nnn.py: -------------------------------------------------------------------------------- 1 | a = input("Input an integer : ") 2 | n1 = int(a) 3 | n2 = int(a + a) 4 | n3 = int(a + a + a) 5 | print(n1 + n2 + n3) 6 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2170249/radio_circulo.py: -------------------------------------------------------------------------------- 1 | from math import pi 2 | 3 | r = float(input("Input the radius of the circle : ")) 4 | 5 | print("The area of the circle with radius " + str(r) + " is: " + str(pi * r ** 2)) 6 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2200299/Documento.py: -------------------------------------------------------------------------------- 1 | documento = input('Ingrese su documento: ') 2 | separar = documento.split(".") 3 | capitalizar = separar[-1] 4 | resultado = capitalizar.capitalize() 5 | print('Su resultado es:', resultado) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2200299/Nombre inverso.py: -------------------------------------------------------------------------------- 1 | nombre = input('Escriba su nombre: ') 2 | apellido = input('Escriba su apellido: ') 3 | nombre_y_apellido = nombre + ' ' + apellido 4 | print('Su nombre invertido es: ' + (nombre_y_apellido[::-1])) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2200299/año100.py: -------------------------------------------------------------------------------- 1 | nombre = input('Escriba su nombre: ') 2 | edad = int(input('Escriba su edad: ')) 3 | if edad < 100: 4 | año_100 = 2021 + (100 - edad) 5 | print(nombre, "a la edad de 100 años, estarás en el año " + str(año_100)) 6 | elif edad == 100: 7 | año_100 = 2021 8 | print(nombre, "este es tu año 100!!! El " + str(año_100)) 9 | else: 10 | print(nombre, 'alto ahí. No te hagas el gracioso.') -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2200299/n + nn + nnn.py: -------------------------------------------------------------------------------- 1 | n = float(input('Dijite su número entero: ')) 2 | # try: 3 | # except: 4 | 5 | entero = int(n) 6 | print(entero) 7 | if entero == n: 8 | c = str(entero) 9 | suma = int(c) + int(c*2) + int(c*3) 10 | print('Su resultado es: ' + str(suma)) 11 | else: 12 | print('lo que dijitó no es un número entero') 13 | 14 | 15 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2200299/volumen.py: -------------------------------------------------------------------------------- 1 | radio = float(input('Dijite el radio de la esfera: ')) 2 | unidades = input('Dijite las unidades del radio: ') 3 | unidades_de_volumen = unidades + '^3' 4 | from math import pi 5 | volumen = (4/3) * pi * (radio**3) 6 | print('El volumen de la esfera es: ' + str(volumen) + ' ' + unidades_de_volumen) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2200299/área.py: -------------------------------------------------------------------------------- 1 | radio = float(input('Dijite el radio del círculo: ')) 2 | unidades = input('Dijite las unidades del radio: ') 3 | unidades_de_área = unidades + '^2' 4 | from math import pi 5 | área = pi * (radio**2) 6 | print('El área del círculo es: ' + str(área ) + ' ' + unidades_de_área) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2200301/Bacon.py: -------------------------------------------------------------------------------- 1 | 2 | # * es un operador 3 | # "hello" es un valor, es un String 4 | # -88.8 es un valor, es un float 5 | # "%" es un string 6 | # - es un operador 7 | # / es un operador 8 | # + es un operador 9 | # 5 es un integer 10 | 11 | # spam es una variable 12 | # 'spam' es un string 13 | 14 | # Tipos de Datos : Integer, float, string, boolean, double 15 | 16 | # La variable tendrá el valor 21 17 | 18 | # Las dos expresiones devuelven lo mismo, "spamspamspam" 19 | 20 | # Las variables no pueden empezar por un número 21 | # podemos usar las funciones int, float y str 22 | 23 | # La expresión causa un error porque 99 en este caso sería un integer 24 | # los integer no se pueden sumar con los string 25 | # en este caso, para solucionar, solo habría que escribir 99 como string, entre "" 26 | 27 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2200301/Edad_100.py: -------------------------------------------------------------------------------- 1 | name = input("¿Cuál es su nombre?: ") 2 | edad = input("¿Cuál es su edad?: ") 3 | edad = int(edad) 4 | age = 2121 - edad 5 | age = str(age) 6 | print(name + ", su edad en 100 años será " + age) 7 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2200301/Nombre_inverso.py: -------------------------------------------------------------------------------- 1 | nombre = input("¿Cúal es su nombre?: ") 2 | apellido = input("¿Cúal es su apellido: ") 3 | no_ap = nombre + " " + apellido 4 | print(no_ap[::-1]) 5 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2200301/area_circulo.py: -------------------------------------------------------------------------------- 1 | 2 | radio = input("¿Cuál es el radio de su círculo?: ") 3 | radio = float(radio) 4 | from math import pi 5 | area = pi*radio**2 6 | area = str(area) 7 | print("El área de su círculo es " + area) 8 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2200301/extension.py: -------------------------------------------------------------------------------- 1 | fn = input("¿Cómo se llama su archivo: ") 2 | ext = fn.split('.') 3 | print(ext[-1]) 4 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2200301/nnn.py: -------------------------------------------------------------------------------- 1 | n = input("Por favor escriba un número entero: ") 2 | n = int(n) 3 | res = n + n * n + n * n * n 4 | print(res) 5 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/lunes_2200301/volumen.py: -------------------------------------------------------------------------------- 1 | radio = input("¿Cuál es el radio de su esfera?: ") 2 | radio = float(radio) 3 | from math import pi 4 | vol = (4 / 3) * pi * (radio**3) 5 | vol = round(vol , 2) 6 | vol = str(vol) 7 | print("el volumen de su esfera es " + vol) 8 | 9 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/viernes_2200273/RETO 1: -------------------------------------------------------------------------------- 1 | print ("ESCRIBIR RADIO CON UN DECIMAL") 2 | radio = float ( input() ) 3 | area = str ( 3.1416 * radio ** 2 ) 4 | print ("SU AREA ES " + area) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/viernes_2200273/RETO 1.1: -------------------------------------------------------------------------------- 1 | print ("NOMBRE") 2 | nombre = input () 3 | print ("APELLIDO") 4 | apellido = input () 5 | ss = nombre + " " + apellido 6 | print (ss[ : : -1]) 7 | 8 | -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/viernes_2200273/RETO 1.2: -------------------------------------------------------------------------------- 1 | print ("ESCRIBA SU NUMERO, POR FAVOR") 2 | n = int (input()) 3 | res = n + n**2 + n**3 4 | print("EL RESULTADO ES" + " " + str(res)) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/viernes_2200273/RETO 1.3: -------------------------------------------------------------------------------- 1 | print ("ESCRIBIR RADIO CON UN DECIMAL") 2 | radio = float ( input() ) 3 | area = str ( 4/3 *3.1416 * radio ** 3 ) 4 | print ("SU VOLUMEN ES " + area ) -------------------------------------------------------------------------------- /Semana1/Reto/Entregas/viernes_2200273/RETO 1.4: -------------------------------------------------------------------------------- 1 | print( " HOLA, COMO ES TU NOMBRE?") 2 | nombre = input() 3 | print (nombre + ", CUANTOS AÑOS TIENES?") 4 | edad = int (input()) 5 | siglo = str(2021 +100 - edad) 6 | print (nombre +" " + "cumpliras 100 años en " + siglo ) 7 | -------------------------------------------------------------------------------- /Semana1/Reto/__pycache__/retos.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana1/Reto/__pycache__/retos.cpython-38.pyc -------------------------------------------------------------------------------- /Semana1/Reto/modulos.py: -------------------------------------------------------------------------------- 1 | from math import pi, sqrt 2 | 3 | # SINTAXIS: 4 | # from nombre_del_modulo import nombre_de_mi_funcion, nombre_de_mi_otra_funcion, ... 5 | from retos import longitud, message 6 | 7 | print(message + " mundo") 8 | 9 | print(pi * 1.1 ** 2) 10 | 11 | numero = 9 12 | 13 | raiz = sqrt(9) 14 | 15 | print(raiz * longitud) 16 | -------------------------------------------------------------------------------- /Semana1/Reto/retos.py: -------------------------------------------------------------------------------- 1 | # SLICING 2 | 3 | # H O L A 4 | # 0 1 2 3 5 | 6 | message = "Hola" 7 | 8 | longitud = len(message) 9 | 10 | # print(message[longitud - 1]) 11 | 12 | # print(message[0:3:2]) 13 | 14 | # lista = ["documento", "word"] 15 | 16 | # print(lista[0]) 17 | # print(lista[-1]) 18 | -------------------------------------------------------------------------------- /Semana1/ejemplo1.py: -------------------------------------------------------------------------------- 1 | # necesito un programa que le pida el nombre al usuario y despues lo salude por ese nombre 2 | 3 | # INPUT: Nombre del usuario 4 | # 1. Obtener el nombre 5 | nombre_del_usuario = input("Ingrese su nombre de usuario: ") 6 | # 2. Formatear el mensaje 7 | message = "Hola, " + nombre_del_usuario 8 | # 3. Mostrarlo al usuario 9 | print(message) 10 | 11 | # OUTPUT: Saludo con el nombre 12 | -------------------------------------------------------------------------------- /Semana1/hello_world.py: -------------------------------------------------------------------------------- 1 | # NECESITO LA EDAD DEL USUARIO PARA PRODUCIR LA EDAD QUE TENDRA EN EL SIGUIENTE AÑO 2 | 3 | # INPUT: Edad de la persona ? Restricciones: edad > 0 4 | # 1. Pedir la edad al usuario 5 | while True: 6 | try: 7 | edad_del_usuario = int(input("Ingrese su edad: ")) 8 | if edad_del_usuario > 0: 9 | break 10 | else: 11 | print("Ingrese una edad valida") 12 | except: 13 | print("Ingrese una edad valida") 14 | # 2. Calcular la edad del usuario en el siguiente año (edad + 1) 15 | edad_mas_uno = edad_del_usuario + 1 16 | # 3. Mostrar el resultado al usuario 17 | print("Su edad dentro de un año será: " + str(edad_mas_uno)) 18 | # OUTPUT: Edad de la persona + 1 19 | 20 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Gruposabado_2172116_reto2/11.obtenernumerosyletras.py: -------------------------------------------------------------------------------- 1 | def contar(cadena): 2 | letras = [] 3 | numeros = [] 4 | 5 | for x in cadena: 6 | if x.isdigit(): 7 | numeros += 1 8 | numeros.append(x) 9 | 10 | elif x.isalpha (): 11 | letras += 1 12 | else: 13 | pass 14 | return digitos, letras 15 | 16 | text_1 = input("Escriba el texto: ") 17 | 18 | 19 | rtdo = contar(text_1) 20 | 21 | print("La cantidad de digitos: %i" % rtdo[0]) 22 | print("La cantidad de letras: %i" % rtdo[1]) 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Gruposabado_2172116_reto2/12.contraseñas.py: -------------------------------------------------------------------------------- 1 | password = input("enter your password") 2 | 3 | if len(password) < 6 or len(password) > 16: 4 | print("contraseña incorrecta") 5 | else: 6 | tiene_misnuculas = False 7 | tiene_mayuscula = False 8 | tiene_numeros = False 9 | tiene_caracter_especial = False 10 | 11 | for caracter in password: 12 | if caracter.isalpha() and caracter.islower(): 13 | tiene_minusculas = True 14 | elif caracter.isalpha() and caracter.isupper(): 15 | tiene_mayusculas = True 16 | elif caracter.isdigit(): 17 | tiene_numeros = True 18 | elif caracter == "#" or caracter == "$" or caracter == "@": 19 | tiene_caracter_especial = True 20 | 21 | if tiene_minusculas and tiene_mayusculas and tiene_caracter_especial and tiene_numeros: 22 | print("constraseña valida") 23 | else: 24 | print("la constraseña es invalida") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Gruposabado_2172116_reto2/13. patrontipoE.py: -------------------------------------------------------------------------------- 1 | cantidad_pisos = 7 2 | 3 | for i in range(7): 4 | if i == 0 or i == 6: 5 | print("*" * 5, end="") 6 | elif i == 1 or i ==2 or i == 4 or i == 5: 7 | else: 8 | print("*" * 4, end="") 9 | print() -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Gruposabado_2172116_reto2/14.patronmario.py: -------------------------------------------------------------------------------- 1 | cantidad_pisos = 4 2 | 3 | for i in range(cantidad_pisos): 4 | print(" " * (cantidad_pisos - (i + 1)) + "#" * (i + 1), end="") 5 | print(" " + "#" * (i + 1)) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Gruposabado_2172116_reto2/15.multiplicaciondebucle.py: -------------------------------------------------------------------------------- 1 | 2 | num = int(input("Escriba un numero entero: ")) 3 | 4 | for i in range(1, 11): 5 | print(f"{i} x {num} = { i * num}") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Gruposabado_2172116_reto2/1_Iteraryusarcondiciones.py: -------------------------------------------------------------------------------- 1 | lista_numeros = range(1500,2701) 2 | 3 | span = [] 4 | spam = [] 5 | 6 | for i in lista_numeros: 7 | if i % 5 == 0: 8 | span.append(i) 9 | continue 10 | if i % 7 == 0: 11 | spam.append(i) 12 | print("los numeros multiplos de 5 son " + str(span)) 13 | print("los numeros multiplos de 7 son " + str(spam)) 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | ## 23 | 24 | ## 25 | 26 | ## -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Gruposabado_2172116_reto2/2_Convertirtemperatura.py: -------------------------------------------------------------------------------- 1 | dato_tem = input("Escriba la temperatura (e.g., 100c, 34f): ") 2 | li = len(dato_tem) 3 | le = int(li)-1 4 | 5 | tem = dato_tem[0:le] 6 | 7 | if dato_tem.endswith("c"): 8 | fahrenheit = (int(tem)* 1.8 + 32) 9 | print ("{}c es equivalente a {}f".format(tem,fahrenheit)) 10 | 11 | if dato_tem.endswith("f"): 12 | cel = (int(tem) - 32) * 5/9; 13 | print ("{}f es equivalente a {}c".format(tem,cel)) 14 | 15 | 16 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Gruposabado_2172116_reto2/3_Adivinaelnúmero.py: -------------------------------------------------------------------------------- 1 | import random 2 | sorteo = (random.randint(1, 9)) 3 | print(sorteo) 4 | 5 | while True: 6 | num = int(input("introduce un numero entre 1 y 9 ")) 7 | if num == sorteo: 8 | print("felicidades, lo lograste") 9 | break 10 | print ("hasta pronto") 11 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Gruposabado_2172116_reto2/4_Patrón de caracteres.py: -------------------------------------------------------------------------------- 1 | l = 5 2 | 3 | 4 | for i in range(1, l + 1): 5 | for j in range(i): 6 | print("* ", end="") 7 | print() 8 | 9 | for i in range(l-1 , 0 , - 1): 10 | for j in range(i): 11 | print("* ", end="") 12 | print () 13 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Gruposabado_2172116_reto2/5_Invertir palabras.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | palabra = input("la palabra es") 4 | palabra_invertida = [] 5 | 6 | for i in palabra: 7 | palabra_invertida = i + str(palabra_invertida) 8 | 9 | print(palabra_invertida) 10 | 11 | ##while i > 0: 12 | ## palabra_invertida += str(i - 1) 13 | ##i = i - 1 14 | ##print("la palabra invertida es. " + palabra_invertida) 15 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Gruposabado_2172116_reto2/6_Pares e impares.py: -------------------------------------------------------------------------------- 1 | lista_numeros = range(1500,2701) 2 | numeros_pares = [] 3 | numeros_impares = [] 4 | 5 | for i in lista_numeros: 6 | if i % 2 == 0: 7 | numeros_pares.append(i) 8 | continue 9 | if i % 2 != 0: 10 | numeros_impares.append(i) 11 | 12 | print("la cantidad de numeros pares son " + str(len(numeros_pares))) 13 | print("la cantidad de numeros impares son " + str(len(numeros_impares))) 14 | 15 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Gruposabado_2172116_reto2/7_Omitir valores.py: -------------------------------------------------------------------------------- 1 | lista_numeros = range(0, 234) 2 | numeros = [] 3 | 4 | for i in lista_numeros: 5 | if i % 3 == 0 or i % 6 == 0: 6 | continue 7 | if i % 1 == 0: 8 | numeros.append(i) 9 | 10 | print("los numeros son " + str(numeros)) 11 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Gruposabado_2172116_reto2/8_Fibonacci.py: -------------------------------------------------------------------------------- 1 | 2 | n = int(input("cuantos resultados desea. ")) 3 | # EJERCICIO 8 4 | 5 | x = 0 6 | y = 1 7 | 8 | print(x) 9 | 10 | while y < 60: 11 | print(y) 12 | x = y 13 | y = x + y 14 | 15 | 16 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Gruposabado_2172116_reto2/9.fizzbuzz.py: -------------------------------------------------------------------------------- 1 | lista_numeros = range(1,51) 2 | numeros = [] 3 | 4 | for i in lista_numeros: 5 | if i % 3 == 0: 6 | print("Fizz") 7 | continue 8 | if i % 5 == 0: 9 | print("Buzz") 10 | continue 11 | if i % 3 == 0 and i % 5 == 0: 12 | print("FizzBuzz") 13 | continue 14 | print(i) 15 | 16 | 17 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2191437/EJERCICIO_1.py: -------------------------------------------------------------------------------- 1 | # EJERCICIO 1 2 | # Encontrar los numeros que son multiplos de 5 y 7 entre 1500 y 2700 3 | 4 | # 1. Definir las listas que contendran los valores 5 | def multiplos (limite_inferior, limite_superior): 6 | 7 | # 2. Evaluar si es multiplo de 5 y 7 8 | if limite_superior > limite_inferior: 9 | 10 | resultado = [] 11 | 12 | for n in range(limite_inferior, limite_superior+1): 13 | if n % 5 == 0 and n % 7 == 0: 14 | resultado.append(n) 15 | 16 | return resultado 17 | 18 | #. raise ValueError("El limite inferior debe ser menor al limite superior.") 19 | 20 | # 3. Definir el bucle o rango de la lista 21 | numeros = multiplos(1500, 2700) 22 | 23 | #4. Imprimir el resultado 24 | print(numeros) 25 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2191437/EJERCICIO_11.py: -------------------------------------------------------------------------------- 1 | # EJERCICIO 11 2 | # Calcule el número de dígitos y letras. 3 | 4 | # 1. Definir la funcion 5 | def contar(cadena): 6 | 7 | #2. Crear variables 8 | digitos = 0 9 | letras = 0 10 | 11 | # 3. Definir la condicion 12 | for x in cadena: 13 | if x.isdigit (): 14 | digitos += 1 15 | elif x.isalpha (): 16 | letras += 1 17 | else: 18 | pass 19 | 20 | return digitos, letras 21 | 22 | # 4. Pedir el texto al usuario 23 | text_1 = input("Escriba el texto: ") 24 | 25 | # 5. Se crea una variable y se muestra la salida de acuerdo a las condiciones 26 | rtdo = contar(text_1) 27 | 28 | print("La cantidad de digitos: %i" % rtdo[0]) 29 | print("La cantidad de letras: %i" % rtdo[1]) 30 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2191437/EJERCICIO_13.py: -------------------------------------------------------------------------------- 1 | # EJERCICIO 13.1 2 | # Imprimir el patron alfabetico "E" 3 | 4 | # ***** 5 | # * 6 | # * 7 | # **** 8 | # * 9 | # * 10 | # ***** 11 | 12 | # 1. Crear el ciclo para los asteriscos 13 | for i in range(7): 14 | 15 | # 2. Definir las condiciones para las lineas de asteriscos 16 | if i == 0 or i == 6: 17 | # 3. Mostrar la salida de esa linea 18 | print("*" * 5, end="") 19 | 20 | elif i == 1 or i == 2 or i == 4 or i == 5: 21 | print("*", end="") 22 | 23 | else: 24 | print("*" * 4, end="") 25 | print() 26 | 27 | 28 | 29 | 30 | 31 | # EJERCICIO 13.2 32 | # # Imprimir el patron de mario bross 33 | 34 | # # # 35 | # ## ## 36 | # ### ### 37 | # #### #### 38 | 39 | # 1. Pedir el numero al usuario 40 | n = int(input("Escriba el numero de renglones de renglones del patron de mario bross: ")) 41 | 42 | # 2. Crear el ciclo para los numerales 43 | for i in range(n+1): 44 | 45 | # 2. Definir los espacios 46 | espacio = n - i 47 | 48 | # 3. Mostrar la salida segun las condiciones 49 | print (" " * espacio + "#" * i + " " + "#" * i) 50 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2191437/EJERCICIO_14.py: -------------------------------------------------------------------------------- 1 | # EJERCICIO 14 2 | # Tabla de multiplicar (del 1 al 10) 3 | 4 | # 1. Pedir el numero al usuario 5 | num = int(input("Escriba un numero entero: ")) 6 | 7 | # 2. Definir el ciclo de iteracion 8 | for i in range(1, 11): 9 | 10 | # 3. Mostrar la salida segun la condicion 11 | print(f"{i} x {num} = { i * num}") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2191437/EJERCICIO_2.py: -------------------------------------------------------------------------------- 1 | # EJERCICIO 2 2 | # Convertir de C a F y de F a C 3 | 4 | # 1. Pedir el numero al usuario 5 | temperatura = input("Escriba la temperatura (ej. 22C, 71.6F) : ") 6 | 7 | # 2. Leer los ultimos dos caracteres 8 | escala = temperatura[-1:] 9 | 10 | # 3. Definir la condicional 11 | if escala == "C": 12 | # 4. Tomar solo el valor numerico de la temperatura para realizar la conversion 13 | temperatura_num = int(temperatura[:-1]) 14 | 15 | # 5. Realizar la conversion 16 | fahrenheit = temperatura_num * (9/5) + 32 17 | 18 | # 6. Mostrar la salida acorde a mi condicion 19 | print("{} es equivalente a {} F".format(temperatura,fahrenheit)) 20 | 21 | elif escala == "F": 22 | 23 | temperatura_num = int(temperatura[:-1]) 24 | 25 | celcius = (temperatura_num - 32) * (5/9) 26 | print("{} es equivalente a {} C".format(temperatura,celcius)) 27 | 28 | else: 29 | print ("Escriba un valor de temperatura valido") 30 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2191437/EJERCICIO_3.py: -------------------------------------------------------------------------------- 1 | # EJERCICIO 3 2 | # Adivina el numero del 1 al 9 3 | 4 | # 1. Definir el numero a adivinar 5 | import random 6 | num_adivinar = random.randint(1,9) 7 | 8 | # 2. Definir el bucle para que el programa continue hasta que el numero se adivine 9 | while True: 10 | 11 | # 3. Pedir el numero al usuario 12 | num = int(input("Ingresa un número :")) 13 | 14 | # 4. Definir la condicional 15 | if num == num_adivinar : 16 | print("¡Bien adivinado!") 17 | break 18 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2191437/EJERCICIO_4.py: -------------------------------------------------------------------------------- 1 | # EJERCICIO 4 2 | # Escribir un programa que construya un patron de caracteres 3 | 4 | # * 5 | # ** 6 | # *** 7 | # **** 8 | # **** 9 | # **** 10 | # *** 11 | # ** 12 | # * 13 | 14 | # 1. Cantidad maxima de asteriscos 15 | n=4 16 | 17 | # 2. Definir la condicional (ciclo anidado) 18 | for i in range(1,n+1): 19 | for j in range(i): 20 | # 3. Mostrar la salida del asterisco con un espacio y una linea para cada ciclo 21 | print("* ", end= "") 22 | print() 23 | 24 | # 4. Mostrar la salida de la linea de la mitad 25 | print("* "*n) 26 | 27 | # 5. Definir la condicional para la segunda mitad del patron (devolver el ciclo anterior) 28 | for i in range (n, 0, -1): 29 | for j in range (i): 30 | print("* ", end= "") 31 | print() 32 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2191437/EJERCICIO_5.py: -------------------------------------------------------------------------------- 1 | # EJERCICIO 5 2 | # Invertir palabras con un bucle 3 | 4 | # 1. Definir la funcion 5 | def inv_palabra(palabra): 6 | #2. Definir variable 7 | rta= "" 8 | 9 | #3. Invertir la palabra de izquierda a derecha 10 | for c in range(len(palabra)-1, -1, -1): 11 | rta += palabra[c] 12 | return rta 13 | 14 | # 4. Pedir la palabra al usuario 15 | frase = input("Escriba una palabara :") 16 | 17 | # 5. Mostrar la salida acorde a la palabara 18 | print(inv_palabra(frase)) 19 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2191437/EJERCICIO_6.py: -------------------------------------------------------------------------------- 1 | # EJERCICIO 6 2 | # Pares e impares en una lista 3 | 4 | # 1. Definir la funcion del contador 5 | def contar(lista): 6 | pares,impares = 0, 0 7 | 8 | #2. Definir condicion para revisar cada numero en la lista 9 | for n in lista: 10 | if n % 2 == 0: 11 | pares += 1 12 | else: 13 | impares += 1 14 | 15 | #3. Devolvemos la cantidad de pares e impares 16 | return pares, impares 17 | 18 | # 4. Definimos la lista de numeros 19 | num = [1, 2, 3, 4, 5, 6, 7, 8, 9] 20 | 21 | # 5. Definimos la variable que da el resultado de pares e impares 22 | rtdo = contar(num) 23 | 24 | # 6. Mostrar la salida de los pares e impares contados 25 | print("La cantidad de pares es: %i" % rtdo[0]) 26 | print("La cantidad de impares es: %i" % rtdo[1]) 27 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2191437/EJERCICIO_7.py: -------------------------------------------------------------------------------- 1 | # EJERCICIO 7 2 | # Omitir valores 3 | # imprimir del 0 al 6 omitiendo el 3 y 6 4 | 5 | # 1. Difinir el bucle y rango de la lista que se va a revisar 6 | for n in range(0, 7): 7 | # 2. Definir la condicion (3 y 6 multiplos de 3) 8 | if n % 3 != 0 or n == 0: 9 | print(n) 10 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2191437/EJERCICIO_8.py: -------------------------------------------------------------------------------- 1 | # EJERCICIO 8 2 | # Obtener la serie de Fibonacci entre 0 y 50. 3 | 4 | # 1. Definir dos variables 5 | x, y = 0, 1 6 | 7 | # 2. Imprimir el primer valor 8 | print(x) 9 | 10 | # 3. Definir la condicion de ciclo 11 | while y < 50: 12 | # 4. Mostrar la salida de la serie Fibonacci 13 | print(y) 14 | 15 | # 5. Se realiza el intercambio de valores de intercambio para obtener la secuencia 16 | x, y = y, x + y 17 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2191437/EJERCICIO_9.py: -------------------------------------------------------------------------------- 1 | # EJERCICIO 9 2 | # Fizzbuzz 3 | 4 | # 1. Definir la lista de numeros 5 | for i in range (1, 50): 6 | 7 | # 2. Definir la condicion 8 | if i % 3 == 0: 9 | 10 | # 3. Mostrar la salida segun las condiciones 11 | print ("Fizz") 12 | 13 | if i % 5 == 0: 14 | print ("Buzz") 15 | 16 | if i % 3 == 0 and i % 5 == 0: 17 | print ("FizzBuzz") 18 | 19 | print (i) 20 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2192097/Nombre_Reves.py: -------------------------------------------------------------------------------- 1 | 2 | print("Ingrese su Nombre: ") 3 | Nombre= str(input()) 4 | print("Ingrese su Apellido: ") 5 | Apellido= str(input()) 6 | L_nombre=int(len(Nombre)) 7 | 8 | L_Apellido= int(len(Apellido)) 9 | 10 | 11 | if L_nombre <=0: 12 | print("Ingrese un nombre valido") 13 | else: 14 | Contador = L_nombre 15 | while Contador >= 0: 16 | lista= Nombre[Contador] 17 | 18 | Contador = L_nombre-1 19 | #print(list(Letra_x)) 20 | #print(Nombre[int(]) 21 | #Lista=list(range(0, L_nombre, 1)) 22 | 23 | #print(Lista) 24 | #print("Su Nombre y Apellido del reves son: " + ) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2192097/Par_impar.py: -------------------------------------------------------------------------------- 1 | numero_ingresado=int(input()) 2 | residuo= numero_ingresado% 2 3 | if numero_ingresado < 0 and residuo == 0: 4 | print("su numero es par y es negativo") 5 | elif residuo == 0: 6 | print("su numero es par") 7 | else: 8 | print("su numero es impar") 9 | 10 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2192097/Patron_asterisco.py: -------------------------------------------------------------------------------- 1 | print("Ingrese el numero de filas que quiere en su patron") 2 | n=int(input()) 3 | 4 | for i in range(1, n+1): 5 | for j in range(i): 6 | print('*', end=' ') 7 | print() 8 | for i in range(n-1, 0, -1): 9 | for j in range(i): 10 | print('*', end=' ') 11 | print() -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2192097/Tabla_multi.py: -------------------------------------------------------------------------------- 1 | print("Ingrese el numero del que desea conocer la tabla") 2 | numero=int(input()) 3 | for i in range(0,11): 4 | Resultado=i *numero 5 | print(numero, "X",i, "=", Resultado) 6 | 7 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2192097/Temperatura.py: -------------------------------------------------------------------------------- 1 | print("ingrese la temperatura seguido de una C si esta en celsius o F si esta en Fahrenheit") 2 | Entrada=input() 3 | Lo=len(Entrada) 4 | La=int(Lo)-1 5 | Temperatura=Entrada[0:La] 6 | #print(Temperatura) 7 | if Entrada.endswith('C'): 8 | Fahrenheit= (int(Temperatura)*1.8)+32 9 | print("Su temperatura en Fahrenheit es: "+ str(Fahrenheit)+'F') 10 | else: 11 | Celsius= (int(Temperatura)-32)*0.555555555555556 12 | print("Su temperatura en Celsius es: "+ str(Celsius)+'°C') -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2192097/multiplos.py: -------------------------------------------------------------------------------- 1 | # seleccionar el rango 2 | print("En este codigo se necesita un rango para obtener los multiplos, por tanto: ") 3 | print("escriba el primer valor") 4 | V_inicial=int(input()) 5 | print("escriba el segundo valor") 6 | V_final=int(input()) 7 | 8 | if V_inicial>=V_final: 9 | print("ingrese un rango de datos valido") 10 | else: 11 | Numero=V_inicial 12 | Residuo=Numero%5 13 | if Residuo ==0 and Numero<=V_final: 14 | lista=Numero 15 | Numero=V_inicial+1 16 | #definir multiplos de 5 17 | #definir multiplos de 7 18 | #mostrarlos en conjunto -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Lunes_2200262_Reto2/Reto2_1Multiplos De5Y7.py: -------------------------------------------------------------------------------- 1 | #Adivinarr multiplos de 5 y 7 entre 1500 y 2700 2 | for i in range(1500,2701): 3 | if i % 5 == 0: 4 | if i % 7 == 0: 5 | print(i) 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Lunes_2200262_Reto2/Reto2_2GradosCyF.py: -------------------------------------------------------------------------------- 1 | #Convertir de grados Celsius a Fahrenheit o viceversa 2 | Celsius = int(input("Ingrese la cantidad de grados CELSIUS a convertir: ")) 3 | Fahrenheit = 1.8*Celsius+32 4 | Fahrenheit_a = int(input("Ingrese la cantidad de grados FAHRENHEIT a convertir: ")) 5 | Celsius_a = Fahrenheit_a/1.8 - 17.77778 6 | 7 | print(Celsius,"grados Celsius equivalen a",Fahrenheit,"grados Farenheit") 8 | print(Fahrenheit_a, "grados Farenheit equivalen a",Celsius_a,"grados celsius") 9 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Lunes_2200262_Reto2/Reto2_3AdivinaDigito.py: -------------------------------------------------------------------------------- 1 | #Adivinar un número de 1 a 9 2 | print("Vamos a adivinar un número de 1 a 9") 3 | Numero_min = 1 4 | Numero_max = 9 5 | import random 6 | numero_aleatorio = random.randint(Numero_min,Numero_max) 7 | numero_escogido = input("Selecciona un número entre" + " " + str(Numero_min) + " " +"y" + " " + str(Numero_max) ) 8 | #El comando random.randint selecciona un número aleatorio entre 1 y 9 en este caso, pues ya los seleccionamos. 9 | 10 | if numero_escogido != numero_aleatorio: 11 | print(input("Selecciona un número entre" + " " + str(Numero_min) + " " +"y" + " " + str(Numero_max) )) 12 | if numero_escogido == numero_aleatorio: 13 | print("Bien adivinado") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Lunes_2200262_Reto2/Reto2_4ImprimirDe0A6.py: -------------------------------------------------------------------------------- 1 | #Imprimir los números de 0 a 6 excepto el 3 y el 6 2 | numeros = range(6) 3 | print(numeros[0]) 4 | print(numeros[1]) 5 | print(numeros[2]) 6 | print(numeros[4]) 7 | print(numeros[5]) 8 | print(numeros[6]) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Lunes_2200262_Reto2/Reto2_5Fibonacci.py: -------------------------------------------------------------------------------- 1 | #Encontrar la serie de Fibonacci entre o y 50. Fibo = 0,1,1,2,3,5,8,21,...} 2 | 3 | #A partir de los 2 primeros números de la serie empezamos a iterar. 4 | fibonacci = [0, 1] 5 | 6 | for i in range(1, 49): 7 | #Sabemos que en la serie, el número siguiente es el anterior (i-1), + el actual (i) 8 | next = fibonacci[i-1] + fibonacci[i] 9 | fibonacci.append(next) 10 | #El comando append permite agregar elementos a la lista. 11 | print(f'Los primeros 50 elementos de la serie Fibonacci son: {fibonacci}') -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Lunes_2200262_Reto2/Reto2_6TablaDeMultiplicar.py: -------------------------------------------------------------------------------- 1 | #Pedir un número y multiplicar ese número de 1 a 10 2 | numero = int(input("Selecciona un numero ")) 3 | 4 | for i in range (1,11): 5 | print(f"{i}*{numero} = {i * numero}") 6 | #Es un bucle que se repite desde 1 hasta 10. Luego debemos imprimir la operación i*número hasta 10, y se ponen en corchetes... 7 | #...para que se tome el valor como variable, o, número. -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Lunes_2200262_Reto2/Reto2_7Invertir.py: -------------------------------------------------------------------------------- 1 | def contador_par_impar(lista): 2 | pares, impares = 0,0 3 | for i in lista: 4 | if i % 2 == 0: 5 | pares += 1 6 | else: 7 | impares += 1 8 | return pares, impares 9 | 10 | 11 | numeros = [1, 2, 3, 4, 5, 6, 7, 9, 10] 12 | resultado = contador_par_impar(numeros) 13 | 14 | print("La cantidad de pares es: %i " % resultado[0]) 15 | print("La cantidad de impares es: %i " % resultado[0]) 16 | 17 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Lunes_2200262_Reto2/Reto3_1ImprimirImpares.py: -------------------------------------------------------------------------------- 1 | lista = [0,1,2,3,4,5,6,7,8,9] 2 | for i in lista: 3 | if i % 2 != 0: 4 | print(i) 5 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Reto2_1Multiplos De5Y7.py: -------------------------------------------------------------------------------- 1 | #Adivinarr multiplos de 5 y 7 entre 1500 y 2700 2 | for i in range(1500,2701): 3 | if i % 5 == 0: 4 | if i % 7 == 0: 5 | print(i) 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Reto2_2GradosCyF.py: -------------------------------------------------------------------------------- 1 | #Convertir de grados Celsius a Fahrenheit o viceversa 2 | Celsius = int(input("Ingrese la cantidad de grados CELSIUS a convertir: ")) 3 | Fahrenheit = 1.8*Celsius+32 4 | Fahrenheit_a = int(input("Ingrese la cantidad de grados FAHRENHEIT a convertir: ")) 5 | Celsius_a = Fahrenheit_a/1.8 - 17.77778 6 | 7 | print(Celsius,"grados Celsius equivalen a",Fahrenheit,"grados Farenheit") 8 | print(Fahrenheit_a, "grados Farenheit equivalen a",Celsius_a,"grados celsius") 9 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Reto2_3AdivinaDigito.py: -------------------------------------------------------------------------------- 1 | #Adivinar un número de 1 a 9 2 | print("Vamos a adivinar un número de 1 a 9") 3 | Numero_min = 1 4 | Numero_max = 9 5 | import random 6 | numero_aleatorio = random.randint(Numero_min,Numero_max) 7 | numero_escogido = input("Selecciona un número entre" + " " + str(Numero_min) + " " +"y" + " " + str(Numero_max) ) 8 | #El comando random.randint selecciona un número aleatorio entre 1 y 9 en este caso, pues ya los seleccionamos. 9 | 10 | if numero_escogido != numero_aleatorio: 11 | print(input("Selecciona un número entre" + " " + str(Numero_min) + " " +"y" + " " + str(Numero_max) )) 12 | if numero_escogido == numero_aleatorio: 13 | print("Bien adivinado") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Reto2_4ImprimirDe0A6.py: -------------------------------------------------------------------------------- 1 | #Imprimir los números de 0 a 6 excepto el 3 y el 6 2 | numeros = range(6) 3 | print(numeros[0]) 4 | print(numeros[1]) 5 | print(numeros[2]) 6 | print(numeros[4]) 7 | print(numeros[5]) 8 | print(numeros[6]) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Reto2_5Fibonacci.py: -------------------------------------------------------------------------------- 1 | #Encontrar la serie de Fibonacci entre o y 50. Fibo = 0,1,1,2,3,5,8,21,...} 2 | 3 | #A partir de los 2 primeros números de la serie empezamos a iterar. 4 | fibonacci = [0, 1] 5 | 6 | for i in range(1, 49): 7 | #Sabemos que en la serie, el número siguiente es el anterior (i-1), + el actual (i) 8 | next = fibonacci[i-1] + fibonacci[i] 9 | fibonacci.append(next) 10 | #El comando append permite agregar elementos a la lista. 11 | print(f'Los primeros 50 elementos de la serie Fibonacci son: {fibonacci}') -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Reto2_6TablaDeMultiplicar.py: -------------------------------------------------------------------------------- 1 | #Pedir un número y multiplicar ese número de 1 a 10 2 | numero = int(input("Selecciona un numero ")) 3 | 4 | for i in range (1,11): 5 | print(f"{i}*{numero} = {i * numero}") 6 | #Es un bucle que se repite desde 1 hasta 10. Luego debemos imprimir la operación i*número hasta 10, y se ponen en corchetes... 7 | #...para que se tome el valor como variable, o, número. -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Reto2_7Invertir.py: -------------------------------------------------------------------------------- 1 | def contador_par_impar(lista): 2 | pares, impares = 0,0 3 | for i in lista: 4 | if i % 2 == 0: 5 | pares += 1 6 | else: 7 | impares += 1 8 | return pares, impares 9 | 10 | 11 | numeros = [1, 2, 3, 4, 5, 6, 7, 9, 10] 12 | resultado = contador_par_impar(numeros) 13 | 14 | print("La cantidad de pares es: %i " % resultado[0]) 15 | print("La cantidad de impares es: %i " % resultado[0]) 16 | 17 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Reto3_1ExtraerImpares.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | arr = np.array([0,1,2,3,4,5,6,7,8,9]) 3 | 4 | arr[arr % 2 == 1] 5 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Lunes_2200262_Reto2/Reto3_3ApilarMatrices.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | a = np.arange(10).reshape(2,-1) 3 | b = np.repeat(1,10).reshape(2,-1) 4 | 5 | #vstack nos permite apilar directamente 2 matrices de forma vertical. 6 | np.vstack([a,b]) 7 | 8 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/README.md: -------------------------------------------------------------------------------- 1 | # Carpeta de entregas de la Semana 2 2 | 3 | Acá es donde debe subir la carpeta con sus retos según lo indicado en el vídeo del [acá en el aula virtual](https://drive.google.com/file/d/1rY_XUXCMwqY3chPxq7QMhZSd6tIs5pBd/view?usp=sharing) 4 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Adivinar_Numeros.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | number = random.randrange(1,9) 4 | guested = False 5 | while not guested: 6 | user_input = int(input("Ingresa un numero")) 7 | if user_input is number: 8 | guested = True 9 | print("Bien adivinado") 10 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Bucles de Mulptiplicaciones.py: -------------------------------------------------------------------------------- 1 | number = int(input("Ingresa numero \n")) 2 | for index in range(1,11): 3 | print(index, "x", number, " = ",number*index) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Contar_Binarios_Numeros.py: -------------------------------------------------------------------------------- 1 | user_input = input() 2 | binary_list = user_input.split(",") 3 | for number in binary_list: 4 | if int(number, 2) % 5 == 0: 5 | print (number) 6 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Convertir_Temperatura.py: -------------------------------------------------------------------------------- 1 | user_input = input("Ingrese la temperatura \n") 2 | scale = user_input[-1] # Saco el ultimo caracter para saber si es F o C 3 | temperature = float(user_input[:-1]) 4 | if (scale == "c") or (scale == "C"): 5 | print((temperature * 1.8) + 32) 6 | else: 7 | print((temperature - 32.0) / 1.8) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Fibonacci.py: -------------------------------------------------------------------------------- 1 | fibonacci = [0, 1] 2 | 3 | for number in range(1,51): 4 | fibonacci.append(fibonacci[-2] + fibonacci[-1]) 5 | print(fibonacci) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/FizzBuzz.py: -------------------------------------------------------------------------------- 1 | ## fizzbuzz 2 | for number in range(1,51): 3 | if (number % 3 == 0) and (number % 5 == 0): 4 | print("FizzBuzz") 5 | elif number % 3 == 0: 6 | print("Fizz") 7 | elif number % 5 == 0: 8 | print("Buzz") 9 | else: 10 | print(number) 11 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Invertir las Palabras.py: -------------------------------------------------------------------------------- 1 | user_input = input("Ingresa una palabra") 2 | inverted = "" 3 | for index in range(len(user_input)-1,-1,-1): 4 | inverted += user_input[index] 5 | print(inverted) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Iteracion y uso_Condicionales.py: -------------------------------------------------------------------------------- 1 | ## iterar y usar condiciones 2 | for number in range(1500,2701): # se pone 20701 para que el ciclo incluya el 20700 3 | if (number % 5 == 0) or (number % 7 == 0): 4 | print(number) 5 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Obtener_Numeros y Letras.py: -------------------------------------------------------------------------------- 1 | user_input = input() 2 | letters = 0 # initiating the count of letters to 0 3 | numeric = 0 # initiating the count of numbers to 0 4 | 5 | for i in user_input: 6 | if i.isdigit(): 7 | numeric += 1 8 | elif i.isalpha(): 9 | letters += 1 10 | else: 11 | pass 12 | 13 | print ("Las letras ingresadas fueron ", letters, "y los digitos ", numeric) 14 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Obtener_Sugundo_Siguiente.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime, timedelta 2 | 3 | user_input = input("Ingrese el tiempo (ejemplo 14h12m14s)\n") 4 | date = datetime.strptime(user_input, "%Hh%Mm%Ss") 5 | date2 = date + timedelta(seconds=1) 6 | print(date2.strftime('%Hh%Mm%Ss')) 7 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Omitir_Valores.py: -------------------------------------------------------------------------------- 1 | for number in range(1,7): 2 | if number % 3 != 0: 3 | print(number) 4 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Pares_Impares.py: -------------------------------------------------------------------------------- 1 | user_input = input("Ingresa secuencia") 2 | odd = 0 3 | even = 0 4 | 5 | num_list = [] 6 | 7 | for number in user_input.split(", "): 8 | num_list.append(int(number)) 9 | 10 | for number in num_list: 11 | if number % 2 == 0: 12 | even = even + 1 13 | else: 14 | odd = odd + 1 15 | print("Pares ", even) 16 | print("Impares ", odd) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Patron E.py: -------------------------------------------------------------------------------- 1 | for index in range (0,7): 2 | if index in [0, 3, 6]: 3 | print("*"*5) 4 | else: 5 | print("*") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Patron_Caracteres.py: -------------------------------------------------------------------------------- 1 | for i in range(1,5): 2 | print("*" * i) 3 | print("*" * 4) 4 | for i in range(4,0,-1): 5 | print("*" * i) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Patron_MarioBros.py: -------------------------------------------------------------------------------- 1 | user_input = int(input("Ingresa numero de filas")) 2 | for index in range(1, user_input + 1): 3 | spaces = user_input - index 4 | print(" " * spaces, "#" * index, "#" * index) 5 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Sofware_Validacion_Contrasenas.py: -------------------------------------------------------------------------------- 1 | import re 2 | user_input = input("Ingrese contraseña\n") 3 | pass_len = len(user_input) 4 | if (pass_len < 6 or pass_len > 16): 5 | print('Contraseña Invalida') 6 | quit() 7 | 8 | numeric = 0 9 | upper_letters = 0 10 | lower_letters = 0 11 | especial_symbols = 0 12 | for i in user_input: 13 | if i.isdigit(): 14 | numeric += 1 15 | elif re.fullmatch(r'[A-Z]',i): 16 | upper_letters += 1 17 | elif re.fullmatch(r'[a-z]',i): 18 | lower_letters += 1 19 | elif re.fullmatch(r'[@#$]',i): 20 | especial_symbols += 1 21 | else: 22 | pass 23 | 24 | print(numeric, upper_letters, lower_letters, especial_symbols) 25 | 26 | if numeric and upper_letters and lower_letters and especial_symbols: 27 | print('Contraseña valida') 28 | else: 29 | print('Contraseña Invalida') 30 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/Sabado_2184609/Valores_Siguientes_Variables.py: -------------------------------------------------------------------------------- 1 | nb1 = int(input("n1")) 2 | nb2 = int(input("n2")) 3 | nb3 = int(input("n3")) 4 | 5 | if nb1 > nb2: 6 | nb1 = nb3 *2 7 | else: 8 | nb1 = nb1 +1 9 | if nb2 > nb3: 10 | nb1 = nb1 + nb3 * 3 11 | else: 12 | nb1 = 0 13 | nb3 = nb3 * 2 + nb2 14 | 15 | print(nb1, nb2, nb3) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/adivinar.py: -------------------------------------------------------------------------------- 1 | print("Adivina un número entre el 1 y el 9") 2 | numero = int(input("Dijite el número ")) 3 | 4 | while numero != int(8): 5 | print("Número equivado. Vuelve a intentar") 6 | numero = input("Dijite el número ") 7 | 8 | if numero == int(8): 9 | print("¡Bien adivinado!") 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/multiplos.py: -------------------------------------------------------------------------------- 1 | numeros = list(range(1500,2701)) 2 | print("los múltiplos de 5 son: ") 3 | for multiplo in numeros: 4 | if multiplo%5 == 0: 5 | print(str(multiplo),end=" ") 6 | 7 | 8 | 9 | print("") 10 | print("") 11 | 12 | print("los múltiplos de 7 son: ") 13 | for multiplo in numeros: 14 | if multiplo%7 == 0: 15 | print(str(multiplo),end=" ") 16 | 17 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/patron.py: -------------------------------------------------------------------------------- 1 | 2 | caracter = input("itroduzca un caracter: ") 3 | n = int(input("introduzca el número de la fila más lárga del patrón:. ")) 4 | 5 | for i in range(1, n + 1): 6 | for x in range(i): 7 | print(caracter, end = " ") 8 | print() 9 | 10 | for i in range(n - 1, 0, -1): 11 | for x in range(i): 12 | print(caracter, end = " ") 13 | print() 14 | 15 | 16 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/segundo.py: -------------------------------------------------------------------------------- 1 | Hora = input("dijite la hora: ") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Reto 2/temperatura.py: -------------------------------------------------------------------------------- 1 | 2 | unidades = input("dijite 'C' si tiene unidades en Celcius o dijite 'F' si tiene unidades en Fahrenheit ") 3 | 4 | while unidades != "C": 5 | if unidades == "F" or unidades == "C": 6 | break 7 | print("Error. Introduce la letra correspondiente y revisa que estén en mayúscula.") 8 | unidades = input("dijite 'C' si tiene unidades en Celcius o dijite 'F' si tiene unidades en Fahrenheit ") 9 | 10 | if unidades == "F" or unidades == "C": 11 | cantidad_numerica = int(input("introduzca la cantidad ")) 12 | 13 | if unidades == "F": 14 | Celcius = (cantidad_numerica - 32) * 5/9 15 | print(str(cantidad_numerica) + " grados Fahrenheit equivalen a " + str(Celcius) + " grados Celcius") 16 | 17 | if unidades == "C": 18 | Fahrenheit = (cantidad_numerica * 9/5) + 32 19 | print(str(cantidad_numerica) + " grados Celcius equivalen a " + str(Fahrenheit) + " grados Fahrenheit") 20 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/SEGUNDO_RETO_AURA_CALDERON: -------------------------------------------------------------------------------- 1 | #Adivinarr multiplos de 5 y 7 entre 1500 y 2700 2 | for i in range(1500,2701): 3 | if i % 5 == 0: 4 | if i % 7 == 0: 5 | print(i) 6 | 7 | 8 | 9 | 10 | #Convertir de grados Celsius a Fahrenheit o viceversa 11 | Celsius = int(input("Ingrese la cantidad de grados CELSIUS a convertir: ")) 12 | Fahrenheit = 1.8*Celsius+32 13 | Fahrenheit_a = int(input("Ingrese la cantidad de grados FAHRENHEIT a convertir: ")) 14 | Celsius_a = Fahrenheit_a/1.8 - 17.77778 15 | 16 | print(Celsius,"grados Celsius equivalen a",Fahrenheit,"grados Farenheit") 17 | print(Fahrenheit_a, "grados Farenheit equivalen a",Celsius_a,"grados celsius") 18 | 19 | #Adivinar un número de 1 a 9 20 | print("Vamos a adivinar un número de 1 a 9") 21 | Numero_min = 1 22 | Numero_max = 9 23 | import random 24 | numero_aleatorio = random.randint(Numero_min,Numero_max) 25 | numero_escogido = input("Selecciona un número entre" + " " + str(Numero_min) + " " +"y" + " " + str(Numero_max) ) 26 | #El comando random.randint selecciona un número aleatorio entre 1 y 9 en este caso, pues ya los seleccionamos. 27 | 28 | if numero_escogido != numero_aleatorio: 29 | print(input("Selecciona un número entre" + " " + str(Numero_min) + " " +"y" + " " + str(Numero_max) )) 30 | if numero_escogido == numero_aleatorio: 31 | print("Bien adivinado") 32 | #Imprimir los números de 0 a 6 excepto el 3 y el 6 33 | numeros = range(6) 34 | print(numeros[0]) 35 | print(numeros[1]) 36 | print(numeros[2]) 37 | print(numeros[4]) 38 | print(numeros[5]) 39 | print(numeros[6]) 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | #Encontrar la serie de Fibonacci entre o y 50. Fibo = 0,1,1,2,3,5,8,21,...} 51 | 52 | #A partir de los 2 primeros números de la serie empezamos a iterar. 53 | fibonacci = [0, 1] 54 | 55 | for i in range(1, 49): 56 | #Sabemos que en la serie, el número siguiente es el anterior (i-1), + el actual (i) 57 | next = fibonacci[i-1] + fibonacci[i] 58 | fibonacci.append(next) 59 | #El comando append permite agregar elementos a la lista. 60 | print(f'Los primeros 50 elementos de la serie Fibonacci son: {fibonacci}') 61 | #Pedir un número y multiplicar ese número de 1 a 10 62 | numero = int(input("Selecciona un numero ")) 63 | 64 | for i in range (1,11): 65 | print(f"{i}*{numero} = {i * numero}") 66 | #Es un bucle que se repite desde 1 hasta 10. Luego debemos imprimir la operación i*número hasta 10, y se ponen en corchetes... 67 | #...para que se tome el valor como variable, o, número. 68 | def contador_par_impar(lista): 69 | pares, impares = 0,0 70 | for i in lista: 71 | if i % 2 == 0: 72 | pares += 1 73 | else: 74 | impares += 1 75 | return pares, impares 76 | 77 | 78 | numeros = [1, 2, 3, 4, 5, 6, 7, 9, 10] 79 | resultado = contador_par_impar(numeros) 80 | 81 | print("La cantidad de pares es: %i " % resultado[0]) 82 | print("La cantidad de impares es: %i " % resultado[0]) 83 | 84 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/SEGUNDO_RETO_MORENO_PABLO_2200292: -------------------------------------------------------------------------------- 1 | #Adivinarr multiplos de 5 y 7 entre 1500 y 2700 2 | for i in range(1500,2701): 3 | if i % 5 == 0: 4 | if i % 7 == 0: 5 | print(i) 6 | 7 | 8 | 9 | 10 | #Convertir de grados Celsius a Fahrenheit o viceversa 11 | Celsius = int(input("Ingrese la cantidad de grados CELSIUS a convertir: ")) 12 | Fahrenheit = 1.8*Celsius+32 13 | Fahrenheit_a = int(input("Ingrese la cantidad de grados FAHRENHEIT a convertir: ")) 14 | Celsius_a = Fahrenheit_a/1.8 - 17.77778 15 | 16 | print(Celsius,"grados Celsius equivalen a",Fahrenheit,"grados Farenheit") 17 | print(Fahrenheit_a, "grados Farenheit equivalen a",Celsius_a,"grados celsius") 18 | 19 | #Adivinar un número de 1 a 9 20 | print("Vamos a adivinar un número de 1 a 9") 21 | Numero_min = 1 22 | Numero_max = 9 23 | import random 24 | numero_aleatorio = random.randint(Numero_min,Numero_max) 25 | numero_escogido = input("Selecciona un número entre" + " " + str(Numero_min) + " " +"y" + " " + str(Numero_max) ) 26 | #El comando random.randint selecciona un número aleatorio entre 1 y 9 en este caso, pues ya los seleccionamos. 27 | 28 | if numero_escogido != numero_aleatorio: 29 | print(input("Selecciona un número entre" + " " + str(Numero_min) + " " +"y" + " " + str(Numero_max) )) 30 | if numero_escogido == numero_aleatorio: 31 | print("Bien adivinado") 32 | #Imprimir los números de 0 a 6 excepto el 3 y el 6 33 | numeros = range(6) 34 | print(numeros[0]) 35 | print(numeros[1]) 36 | print(numeros[2]) 37 | print(numeros[4]) 38 | print(numeros[5]) 39 | print(numeros[6]) 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | #Encontrar la serie de Fibonacci entre o y 50. Fibo = 0,1,1,2,3,5,8,21,...} 51 | 52 | #A partir de los 2 primeros números de la serie empezamos a iterar. 53 | fibonacci = [0, 1] 54 | 55 | for i in range(1, 49): 56 | #Sabemos que en la serie, el número siguiente es el anterior (i-1), + el actual (i) 57 | next = fibonacci[i-1] + fibonacci[i] 58 | fibonacci.append(next) 59 | #El comando append permite agregar elementos a la lista. 60 | print(f'Los primeros 50 elementos de la serie Fibonacci son: {fibonacci}') 61 | #Pedir un número y multiplicar ese número de 1 a 10 62 | numero = int(input("Selecciona un numero ")) 63 | 64 | for i in range (1,11): 65 | print(f"{i}*{numero} = {i * numero}") 66 | #Es un bucle que se repite desde 1 hasta 10. Luego debemos imprimir la operación i*número hasta 10, y se ponen en corchetes... 67 | #...para que se tome el valor como variable, o, número. 68 | def contador_par_impar(lista): 69 | pares, impares = 0,0 70 | for i in lista: 71 | if i % 2 == 0: 72 | pares += 1 73 | else: 74 | impares += 1 75 | return pares, impares 76 | 77 | 78 | numeros = [1, 2, 3, 4, 5, 6, 7, 9, 10] 79 | resultado = contador_par_impar(numeros) 80 | 81 | print("La cantidad de pares es: %i " % resultado[0]) 82 | print("La cantidad de impares es: %i " % resultado[0]) 83 | 84 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/adivina_el_numero.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | number = random.randrange(1,9) 4 | guested = False 5 | while not guested: 6 | user_input = int(input("Ingresa un numero")) 7 | if user_input is number: 8 | guested = True 9 | print("Bien adivinado") 10 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/contar_numeros_binarios.py: -------------------------------------------------------------------------------- 1 | user_input = input() 2 | binary_list = user_input.split(",") 3 | for number in binary_list: 4 | if int(number, 2) % 5 == 0: 5 | print (number) 6 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/convertir_temperatura.py: -------------------------------------------------------------------------------- 1 | user_input = input("Ingrese la temperatura \n") 2 | scale = user_input[-1] # Saco el ultimo caracter para saber si es F o C 3 | temperature = float(user_input[:-1]) 4 | if (scale == "c") or (scale == "C"): 5 | print((temperature * 1.8) + 32) 6 | else: 7 | print((temperature - 32.0) / 1.8) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/fibonacci.py: -------------------------------------------------------------------------------- 1 | fibonacci = [0, 1] 2 | 3 | for number in range(1,51): 4 | fibonacci.append(fibonacci[-2] + fibonacci[-1]) 5 | print(fibonacci) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/fizzbuzz.py: -------------------------------------------------------------------------------- 1 | ## fizzbuzz 2 | for number in range(1,51): 3 | if (number % 3 == 0) and (number % 5 == 0): 4 | print("FizzBuzz") 5 | elif number % 3 == 0: 6 | print("Fizz") 7 | elif number % 5 == 0: 8 | print("Buzz") 9 | else: 10 | print(number) 11 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/invertir_palabras.py: -------------------------------------------------------------------------------- 1 | user_input = input("Ingresa una palabra") 2 | inverted = "" 3 | for index in range(len(user_input)-1,-1,-1): 4 | inverted += user_input[index] 5 | print(inverted) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/iterar_y_usar_condiciones.py: -------------------------------------------------------------------------------- 1 | ## iterar y usar condiciones 2 | for number in range(1500,2701): # se pone 20701 para que el ciclo incluya el 20700 3 | if (number % 5 == 0) or (number % 7 == 0): 4 | print(number) 5 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/multiplicacion_con_bucles.py: -------------------------------------------------------------------------------- 1 | number = int(input("Ingresa numero \n")) 2 | for index in range(1,11): 3 | print(index, "x", number, " = ",number*index) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/obtener_el_siguiente_segundo.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime, timedelta 2 | 3 | user_input = input("Ingrese el tiempo (ejemplo 14h12m14s)\n") 4 | date = datetime.strptime(user_input, "%Hh%Mm%Ss") 5 | date2 = date + timedelta(seconds=1) 6 | print(date2.strftime('%Hh%Mm%Ss')) 7 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/obtener_numeros_y_letras.py: -------------------------------------------------------------------------------- 1 | user_input = input() 2 | letters = 0 # initiating the count of letters to 0 3 | numeric = 0 # initiating the count of numbers to 0 4 | 5 | for i in user_input: 6 | if i.isdigit(): 7 | numeric += 1 8 | elif i.isalpha(): 9 | letters += 1 10 | else: 11 | pass 12 | 13 | print ("Las letras ingresadas fueron ", letters, "y los digitos ", numeric) 14 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/omitir_valores.py: -------------------------------------------------------------------------------- 1 | for number in range(1,7): 2 | if number % 3 != 0: 3 | print(number) 4 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/pares_e_impares.py: -------------------------------------------------------------------------------- 1 | user_input = input("Ingresa secuencia") 2 | odd = 0 3 | even = 0 4 | 5 | num_list = [] 6 | 7 | for number in user_input.split(", "): 8 | num_list.append(int(number)) 9 | 10 | for number in num_list: 11 | if number % 2 == 0: 12 | even = even + 1 13 | else: 14 | odd = odd + 1 15 | print("Pares ", even) 16 | print("Impares ", odd) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/patron_E.py: -------------------------------------------------------------------------------- 1 | for index in range (0,7): 2 | if index in [0, 3, 6]: 3 | print("*"*5) 4 | else: 5 | print("*") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/patron_de_caracteres.py: -------------------------------------------------------------------------------- 1 | for i in range(1,5): 2 | print("*" * i) 3 | print("*" * 4) 4 | for i in range(4,0,-1): 5 | print("*" * i) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/patron_mario_bros.py: -------------------------------------------------------------------------------- 1 | user_input = int(input("Ingresa numero de filas")) 2 | for index in range(1, user_input + 1): 3 | spaces = user_input - index 4 | print(" " * spaces, "#" * index, "#" * index) 5 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/sofware_que_valida_contrasenas.py: -------------------------------------------------------------------------------- 1 | import re 2 | user_input = input("Ingrese contraseña\n") 3 | pass_len = len(user_input) 4 | if (pass_len < 6 or pass_len > 16): 5 | print('Contraseña Invalida') 6 | quit() 7 | 8 | numeric = 0 9 | upper_letters = 0 10 | lower_letters = 0 11 | especial_symbols = 0 12 | for i in user_input: 13 | if i.isdigit(): 14 | numeric += 1 15 | elif re.fullmatch(r'[A-Z]',i): 16 | upper_letters += 1 17 | elif re.fullmatch(r'[a-z]',i): 18 | lower_letters += 1 19 | elif re.fullmatch(r'[@#$]',i): 20 | especial_symbols += 1 21 | else: 22 | pass 23 | 24 | print(numeric, upper_letters, lower_letters, especial_symbols) 25 | 26 | if numeric and upper_letters and lower_letters and especial_symbols: 27 | print('Contraseña valida') 28 | else: 29 | print('Contraseña Invalida') 30 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2184607/valores_de_las_siguientes_variables.py: -------------------------------------------------------------------------------- 1 | nb1 = int(input("n1")) 2 | nb2 = int(input("n2")) 3 | nb3 = int(input("n3")) 4 | 5 | if nb1 > nb2: 6 | nb1 = nb3 *2 7 | else: 8 | nb1 = nb1 +1 9 | if nb2 > nb3: 10 | nb1 = nb1 + nb3 * 3 11 | else: 12 | nb1 = 0 13 | nb3 = nb3 * 2 + nb2 14 | 15 | print(nb1, nb2, nb3) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2200269/Adivina_el_número.py: -------------------------------------------------------------------------------- 1 | print("Adivine el número entre 1 y 9") 2 | 3 | #Importar el modulo random con el fin de generar números aleatorios 4 | import random as rd 5 | 6 | #utilizar la función rd.randint(rango de números) para obtener números enteros aleatorios 7 | A = rd.randint(1,9) 8 | print(A) 9 | Usuario = int(input("Ingrese su número:")) 10 | 11 | #Crear un bucle con un condicional, el cual determine si el número del usuario es igual al que genera la función random 12 | while Usuario != A: 13 | Usuario = int(input("Ingrese su número:")) 14 | else: 15 | print("¡Bien adivinado!") 16 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2200269/Convertir_temperatura.py: -------------------------------------------------------------------------------- 1 | #Inputs: Valores de temperatura y unidades 2 | Valor = float(input("VALOR TEMPERATURA:")) 3 | Unidad = input("UNIDAD:") 4 | #Realizar conversiones 5 | Conversión_C_F = 9/5*Valor + 32 6 | Conversión_F_C = 5/9*(Valor - 32) 7 | #Output: Bucle para con condición para obtener la temperatura teniendo en cuenta la unidad inicial 8 | for caracter in Unidad: 9 | if caracter == "C" or caracter == "c": 10 | print("TEMPERATURA EN F:",Conversión_C_F) 11 | 12 | elif caracter in Unidad == "F" or Unidad == "f": 13 | print("TEMPERATURA EN C:",Conversión_F_C) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2200269/Fibonacci.py: -------------------------------------------------------------------------------- 1 | #Crear una lista vacia para agrupar los valores de la secuencia 2 | Lista = [] 3 | 4 | #Definir un bucle con condicionales para lograr obtener las entradas necesarias de la lista 5 | for i in range(0,51): 6 | if i <= 1: 7 | Lista.append(i) 8 | 9 | elif i >= 2: 10 | #Para este caso resulta conveniente usar la función de obtener un dato especifico dentro de una lista 11 | #Sabemos que una nueva entrada dentro de la secuencia es el resultado de la suma de las dos anteriores 12 | X = Lista[i-1] + Lista[i-2] 13 | Lista.append(X) 14 | 15 | print(Lista) 16 | 17 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2200269/FizzBuzz.py: -------------------------------------------------------------------------------- 1 | for i in range(1,51): 2 | if i % 3 == 0 and i % 5 == 0: 3 | print("FizzBuzz ") 4 | elif i % 5 == 0: 5 | print("Buzz ") 6 | elif i % 3 == 0: 7 | print("Fizz ") 8 | else: 9 | print(i) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2200269/Invertir_palabras.py: -------------------------------------------------------------------------------- 1 | Palabra = input("INGRESE PALABRA:") 2 | #Crear un string vacion en el que se agrupe la nueva palabra 3 | PF = "" 4 | for i in Palabra: 5 | PF = i + PF 6 | print ("PALABRA INVERTIDA:",PF) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2200269/Multiplicación.py: -------------------------------------------------------------------------------- 1 | #Crear un condicional para permitir que el usuario ingrese enteros o decimales sin producirse errores 2 | Pregunta = input("¿Su número es entero o decimal?: ") 3 | if Pregunta == "Entero" or Pregunta == "entero": 4 | 5 | #Pedir número al usuario 6 | A = input("ingrese número entero:") 7 | B = int(A) 8 | elif Pregunta == "Decimal" or Pregunta == "decimal": 9 | A = input("ingrese número decimal:") 10 | B = float(A) 11 | 12 | #Crear un contador con el fin de evitar que while sea infinito 13 | Contador = 0 14 | 15 | #Determinar que la condición del contador sea menor a 10 ya que necesitamos la tabla del número de 1 a 10 16 | while Contador < 10: 17 | X = B * (Contador + 1) 18 | Contador = Contador + 1 19 | print(f"{B} x {Contador} = {X}") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2200269/Obtener_números_letras.py: -------------------------------------------------------------------------------- 1 | #Crear una función que cuente los digitos y las letras de una cadena de caracteres 2 | def contar_digitos_letras(cadena): 3 | 4 | #Denifir el contador para letras y digitos, empezando en cero 5 | Letras = 0 6 | Digitos = 0 7 | 8 | #Desarrollar un bucle que pase por todos los componentes de la cadena 9 | for i in cadena: 10 | 11 | #utilizar la función variable.isalpha() para saber si es una letra 12 | if i.isalpha(): 13 | Letras = Letras + 1 14 | 15 | #Utilizar la función variable.isdigit() para saber si es un digito 16 | elif i.isdigit(): 17 | Digitos = Digitos + 1 18 | 19 | #Definir lo que me devolverá la función con la palabra return 20 | return f"las letras ingresadas fueron {Letras} y los digitos {Digitos}" 21 | 22 | #Uilizar la función input para permitir que el usuario ingrese la palabra que desee 23 | Palabra = input("INGRESE CADENA DE TEXTO:") 24 | 25 | #Utilizar la fúnción creada e imprimir el resultado obtenido 26 | Resultado = contar_digitos_letras(Palabra) 27 | print (Resultado) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2200269/Omitir_valores.py: -------------------------------------------------------------------------------- 1 | Lista = [0,1,2,3,4,5,6] 2 | l = [] 3 | for i in Lista: 4 | if i != 3 and i != 6: 5 | omitidos = i 6 | l.append(omitidos) 7 | print(l) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2200269/Pares_impares.py: -------------------------------------------------------------------------------- 1 | Números = input("INSERTE NÚMEROS SEPARADOS POR COMAS:") 2 | Lista = Números.split(",") 3 | contador = 0 4 | contador2 = 0 5 | for i in Lista: 6 | if int(i) % 2 == 0: 7 | contador = contador + 1 8 | else: 9 | contador2 = contador2 +1 10 | print(f"CANTIDAD DE NÚMEROS PARES:{contador}") 11 | print(f"CANTIDAD DE NÚMEROS IMPARES:{contador2}") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Sábado_2200269/múltiplos.py: -------------------------------------------------------------------------------- 1 | #Crear una lista vacia para incluir los múltiplos de 5 y 7 2 | Múltiplos = [] 3 | 4 | #Crear un bucle en el rango que se me pide y que cumpla con las condiciones dadas 5 | for i in range(1500,2701): 6 | M5 = i % 5 7 | M7 = i % 7 8 | if M5 == 0 and M7 == 0: 9 | Múltiplos.append(i) 10 | 11 | print(f"Múltiplos de 5 y 7: {Múltiplos}") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Viernes_2170255/Adivinar un número.py: -------------------------------------------------------------------------------- 1 | # Adivinar un número generado aleatoriamente entre 1 y 9 2 | numero = int(input("¡Prueba tu suerte! Ingresa un numero entero entre 1 y 9: ")) 3 | from random import* 4 | n = randint(1,9) 5 | print("El número aleatorio es {}".format(n)) 6 | while numero != n: 7 | print("Sigue intentando") 8 | numero= int(input("Por favor ingrese un nuevo numero: ")) 9 | n = randint(1,9) 10 | print("El número aleatorio es {}".format(n)) 11 | print("¡Acertaste!") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Viernes_2170255/Convertir temperaturas.py: -------------------------------------------------------------------------------- 1 | # Convertir temperaturas desde grados Celsius a Fahrenheit o al contrario 2 | tem = input("Ingrese el valor de temperatura y su respectiva unidad (en mayuscula): ") 3 | unidad = tem[-1] 4 | num = tem[:-1] 5 | if unidad == "F": 6 | celsius = (int(num) - 32)*(5/9) 7 | print("La temperatura en celsius es {}".format(celsius)) 8 | elif unidad == "C": 9 | fahrenheit = (int(num)*(9/5)) + 32 10 | print("La temperatura en Fahrenheit es {}".format(fahrenheit)) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Viernes_2170255/Fibonacci entre 0 y 50.py: -------------------------------------------------------------------------------- 1 | #Fibonacci entre 0 y 50 2 | n=0 3 | print(n) 4 | n1=1 5 | print(n1) 6 | while n<20: 7 | n=n1+n #1 8 | print(n) 9 | n1=n1+n 10 | print(n1) 11 | print("fin") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Viernes_2170255/Invertir palabras.py: -------------------------------------------------------------------------------- 1 | # Invertir palabras 2 | palabra = input("Por favor ingrese una palabra: ") 3 | num_letras = len(palabra) 4 | n=-1 5 | for caracter in palabra: 6 | letra= palabra[n] 7 | if num_letras+n >= 0: 8 | print(letra,end=("")) 9 | n -= 1 10 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Viernes_2170255/Mario Bros.py: -------------------------------------------------------------------------------- 1 | #Mario Bros 2 | n= int(input("Ingrese el número de filas que desea obter: ")) 3 | for i in range (0,n+1): 4 | ecuacion= i*"#" + " " + i*"#" 5 | print("{:^20}".format(ecuacion)) 6 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Viernes_2170255/Numero binarios.py: -------------------------------------------------------------------------------- 1 | # Numero binarios 2 | dato=(input("Ingrese una secuencia de numeros binarios separados por una coma: ")) 3 | lista=(dato.split(',')) 4 | salida=[] 5 | for numerob in lista: 6 | binarioinv=numerob[::-1] 7 | ciclo=0 8 | dec=0 9 | for digito in binarioinv: 10 | predec=int(digito)*2**ciclo 11 | ciclo+=1 12 | int(predec) 13 | dec+=predec 14 | if(dec%5==0): 15 | salida.append(numerob) 16 | sal1=(str(salida).replace("[","").replace("'","").replace("]","")) 17 | print("Los numeros binarios divisibles en 5 son: ",sal1) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Viernes_2170255/Número de dígitos y letras.py: -------------------------------------------------------------------------------- 1 | #Número de dígitos y letras. 2 | cadena = input("Ingrese una cadena de numeros y letras: ") 3 | digito = 0 4 | letra = 0 5 | for caracter in cadena: 6 | if caracter.isdigit(): 7 | digito += 1 8 | elif caracter.isalpha(): 9 | letra += 1 10 | print("Las letras ingresadas fueron {} y los digitos {}".format(letra,digito)) 11 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Viernes_2170255/Omitir valores.py: -------------------------------------------------------------------------------- 1 | # Omitir valores 2 | for i in range(0,7): 3 | if i != 3 and i !=6: 4 | print(i) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Viernes_2170255/Pares e impares.py: -------------------------------------------------------------------------------- 1 | # Pares e impares 2 | lista = input("Ingrese una lista de numeros separados por una coma(,): ") 3 | numeros =(lista.split(",")) 4 | pares=0 5 | impares=0 6 | for caracter in numeros: 7 | if int(caracter) %2 == 0: 8 | pares +=1 9 | elif int(caracter) %2 != 0: 10 | impares +=1 11 | print("En su lista hay {} impares y {} pares".format(impares,pares)) 12 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Viernes_2170255/Patrón E.py: -------------------------------------------------------------------------------- 1 | # Patrón E 2 | for i in range (13): 3 | if i==0 or i==6 or i==12: 4 | print("*****") 5 | if i==2 or i==4 or i==8 or i==10: 6 | print("*") 7 | if i==1 or i==3 or i==5 or i==7 or i==9 or i==11: 8 | print(" ") 9 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Viernes_2170255/Patrón de caracteres1.py: -------------------------------------------------------------------------------- 1 | # Patrón de caracteres1 2 | for i in range (9): 3 | if i == 0 or i==8: 4 | print("*") 5 | if i == 1 or i==7: 6 | print("* *") 7 | if i == 2 or i==6: 8 | print("* * *") 9 | if i == 3 or i==4 or i==5: 10 | print("* * * *") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Viernes_2170255/Tablas de multiplicar.py: -------------------------------------------------------------------------------- 1 | # Tablas de multiplicar 2 | numero= int(input("Ingrese un numero entero: ")) 3 | print("Tabla del " + str(numero)) 4 | for i in range (11): 5 | valor = i*numero 6 | print("{} x {} = {}".format(i,numero,valor)) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Viernes_2170255/fizzbuzz.py: -------------------------------------------------------------------------------- 1 | #fizzbuzz 2 | n=0 3 | while n<=50: 4 | if n%3 == 0 and n%5 ==0: 5 | print("FizzBuzz") 6 | if n%3 == 0 and n%5 !=0: 7 | print("Fizz") 8 | if n%5 == 0 and n%3 !=0: 9 | print("Buzz") 10 | elif n%3 != 0 and n%5 !=0: 11 | print(n) 12 | n += 1 13 | print("Fin del programa") 14 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Viernes_2170255/números que son múltiplos de 5 y 7.py: -------------------------------------------------------------------------------- 1 | # Encontrar los números que son múltiplos de 5 y 7, entre 1500 y 2700 (ambos incluidos) 2 | n=1500 3 | while n <= 2700: 4 | multiplo5 = n%5 5 | multiplo7 = n%7 6 | if multiplo5 == 0 and multiplo7 == 0: 7 | print(n) 8 | n += 1 9 | print("Fin de los multiplos de 5 y 7") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/Viernes_2170255/validar contraseñas.py: -------------------------------------------------------------------------------- 1 | # validar contraseñas (los espacios tambien se consideran caracteres especiales) 2 | contraseña = input("Ingrese su contraseña: ") 3 | mayuscula = 0 4 | minuscula = 0 5 | numero = 0 6 | especial = 0 7 | longitud = 0 8 | if len(contraseña)>=6 and len(contraseña)<=16: 9 | longitud += 1 10 | for caracter in contraseña: 11 | if caracter.isalpha(): 12 | if caracter.isupper(): 13 | mayuscula += 1 14 | if caracter.islower(): 15 | minuscula += 1 16 | else: 17 | especial += 1 18 | if caracter.isdigit(): 19 | numero += 1 20 | if mayuscula!=0 and minuscula!=0 and numero!=0 and especial!=0 and longitud!=0: 21 | print("Su contraseña es valida") 22 | else: 23 | print("Su contraseña NO es valida, ingrese una que cumpla las condiciones indicadas.") 24 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes.2200273/RETO 2.1: -------------------------------------------------------------------------------- 1 | def multiple (valor, multiple): 2 | return True if valor % multiple == 0 else False 3 | 4 | multiples_3=[] 5 | multiples_5=[] 6 | 7 | for i in range(1500, 2700): 8 | 9 | if multiple(i, 3): 10 | multiples_3.append(i) 11 | 12 | if multiple(i, 5): 13 | multiples_5.append(i) 14 | 15 | print ("Los multiples de 3 son:", multiples_3) 16 | print ("\nLos multiples de 5 son:", multiples_5) 17 | 18 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes.2200273/Reto2_2GradosCyF.py: -------------------------------------------------------------------------------- 1 | #Convertir de grados Celsius a Fahrenheit o viceversa 2 | Celsius = int(input("Ingrese la cantidad de grados CELSIUS a convertir: ")) 3 | Fahrenheit = 1.8*Celsius+32 4 | Fahrenheit_a = int(input("Ingrese la cantidad de grados FAHRENHEIT a convertir: ")) 5 | Celsius_a = Fahrenheit_a/1.8 - 17.77778 6 | 7 | print(Celsius,"grados Celsius equivalen a",Fahrenheit,"grados Farenheit") 8 | print(Fahrenheit_a, "grados Farenheit equivalen a",Celsius_a,"grados celsius") 9 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes.2200273/Reto2_3AdivinaDigito (1).py: -------------------------------------------------------------------------------- 1 | #Adivinar un número de 1 a 9 2 | print("Vamos a adivinar un número de 1 a 9") 3 | Numero_min = 1 4 | Numero_max = 9 5 | import random 6 | numero_aleatorio = random.randint(Numero_min,Numero_max) 7 | numero_escogido = input("Selecciona un número entre" + " " + str(Numero_min) + " " +"y" + " " + str(Numero_max) ) 8 | #El comando random.randint selecciona un número aleatorio entre 1 y 9 en este caso, pues ya los seleccionamos. 9 | 10 | if numero_escogido != numero_aleatorio: 11 | print(input("Selecciona un número entre" + " " + str(Numero_min) + " " +"y" + " " + str(Numero_max) )) 12 | if numero_escogido == numero_aleatorio: 13 | print("Bien adivinado") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes.2200273/Reto2_4ImprimirDe0A6.py: -------------------------------------------------------------------------------- 1 | numeros = range(7) 2 | print (numeros[0]) 3 | print (numeros[1]) 4 | print (numeros[2]) 5 | print (numeros[4]) 6 | print (numeros[5]) 7 | print (numeros[6]) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes.2200273/Reto2_5Fibonacci.py: -------------------------------------------------------------------------------- 1 | fibonacci = [0, 1] 2 | 3 | for i in range(1, 49):next = fibonacci[i-1] + fibonacci[i] 4 | fibonacci.append(next) 5 | #El comando append permite agregar elementos a la lista. 6 | print (f'Los primeros 50 elementos de la serie Fibonacci son: {fibonacci}') -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes.2200273/Reto2_6TablaDeMultiplicar.py: -------------------------------------------------------------------------------- 1 | #Pedir un número y multiplicar ese número de 1 a 10 2 | numero = int(input("Selecciona un numero ")) 3 | 4 | for i in range (1,11): 5 | print(f"{i}*{numero} = {i * numero}") 6 | #Es un bucle que se repite desde 1 hasta 10. Luego debemos imprimir la operación i*número hasta 10, y se ponen en corchetes... 7 | #...para que se tome el valor como variable, o, número. -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes.2200273/Reto2_7Invertir.py: -------------------------------------------------------------------------------- 1 | def contador_par_impar(lista): 2 | pares, impares = 0,0 3 | for i in lista: 4 | if i % 2 == 0: 5 | pares += 1 6 | else: 7 | impares += 1 8 | return pares, impares 9 | 10 | 11 | numeros = [1, 2, 3, 4, 5, 6, 7, 9, 10] 12 | resultado = contador_par_impar(numeros) 13 | 14 | print("La cantidad de pares es: %i " % resultado[0]) 15 | print("La cantidad de impares es: %i " % resultado[0]) 16 | 17 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/Temperatura.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import re 3 | print("ingrese su temperatura ") 4 | Temperatura = input() 5 | tempeText = str(Temperatura) 6 | 7 | if tempeText.endswith("c" or "C"): 8 | valor = [float(s) for s in re.findall(r'-?\d+\.?\d*', tempeText)] 9 | valor_numerico = valor[0] 10 | farenjei = ( 9/5 * float(valor_numerico)) + 32 11 | print("su temperatura en grados farenjei es igual a " +str(farenjei)) 12 | elif tempeText.endswith("f" or "F"): 13 | valor = [float(s) for s in re.findall(r'-?\d+\.?\d*', tempeText)] 14 | valor_numerico = valor[0] 15 | celcius = (float(valor_numerico)-32)/1.8 16 | print("su temperatura en grados celcius es igual a " + str(celcius)) 17 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/adivinaodr.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import random 3 | 4 | numero = int(random.randrange(1,9,1)) 5 | print(numero) 6 | print("advine el numero, igrese un valor de 1 a 9") 7 | valor_usuario = int(input ()) 8 | if valor_usuario == numero: 9 | print("es es") 10 | if valor_usuario != numero: 11 | print("ingrese otro") 12 | Newvalor_usuario = input() 13 | while int(Newvalor_usuario) !=numero: 14 | 15 | print("ingrese otro") 16 | Newvalor_usuario = input() 17 | 18 | print(" ese es") 19 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/binarios.py: -------------------------------------------------------------------------------- 1 | 2 | lista = [input()] 3 | convertdo = str(lista) 4 | print (convertdo) 5 | 6 | separados = convertdo.split(',') 7 | print (separados) 8 | print (len(separados)) 9 | listado = [] 10 | for i in range(len(separados)): 11 | elemento = separados[i] 12 | if elemento == "1010" : 13 | listado.append(elemento) 14 | print(listado) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/contraseña.py: -------------------------------------------------------------------------------- 1 | 2 | print("ingrese su contraseña") 3 | contraseña = input() 4 | cantidad = len(contraseña) 5 | numeros = 0 6 | letras = 0 7 | mayusculas = 0 8 | caracter = 0 9 | for i in contraseña : 10 | if i.isalpha(): 11 | letras = letras + 1 12 | 13 | for i in contraseña : 14 | if i.isdigit(): 15 | numeros = numeros + 1 16 | 17 | for i in contraseña: 18 | if i.isupper(): 19 | mayusculas = mayusculas + 1 20 | for i in contraseña: 21 | if i == "$" or i=="#" or i=="@": 22 | caracter = caracter + 1 23 | 24 | if letras>0 and mayusculas>0 and numeros >0 and caracter>0 and cantidad>=6 and cantidad <=15 : 25 | print ("contraseña valida") 26 | else: 27 | print("contraseña invalida") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/fiboachi.py: -------------------------------------------------------------------------------- 1 | from typing import final 2 | 3 | 4 | lista = list(range(0,51)) 5 | print(lista) 6 | fibonaciii = [0,1] 7 | cantidad = len(lista) 8 | for i in range(0, int(lista[-1])): 9 | numero = (fibonaciii[i]) + (fibonaciii[i+1]) 10 | fibonaciii.append(numero) 11 | print(fibonaciii) 12 | final = [] 13 | print(final) 14 | cantidad = len(fibonaciii) 15 | for i in range(0 , cantidad): 16 | num_final = (fibonaciii[i]) 17 | if num_final <= 50 : 18 | final.append(num_final) 19 | 20 | print(final) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/fizzbuzz.py: -------------------------------------------------------------------------------- 1 | resultado = [] 2 | for i in range(0,51): 3 | elemento = i 4 | residuotres = elemento % 3 5 | residuocinco = elemento % 5 6 | if residuotres == 0 and residuocinco != 0: 7 | resultado.append("fizz") 8 | elif residuocinco == 0 and residuotres != 0 : 9 | resultado.append("buzz") 10 | elif residuocinco == 0 and residuotres == 0 : 11 | resultado.append("fizzbuzz") 12 | else: 13 | resultado.append(i) 14 | print(resultado) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/invertida_bucle.py: -------------------------------------------------------------------------------- 1 | print("ingrese su palabra") 2 | palabra_usario = str(input()) 3 | Numeroletras = len(palabra_usario) 4 | print(Numeroletras) 5 | invertida = [] 6 | for i in range(0,Numeroletras): 7 | invertida.append(palabra_usario[(Numeroletras - 1 - i)]) 8 | print (invertida) 9 | corrida = "su palabra invertida es: " 10 | for i in range(0,Numeroletras): 11 | corrida = corrida + str(invertida[i]) 12 | 13 | print(corrida) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/mariobross.py: -------------------------------------------------------------------------------- 1 | print("ingrese las filas") 2 | filas = int(input ()) 3 | for i in range(filas) : 4 | print(' '*(filas-1-i) + '#'*(i+1) + ' ' + '#'*(i+1) ) 5 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/multBucles.py: -------------------------------------------------------------------------------- 1 | print("ingrese el numero para hacer la tabla ") 2 | numero = int(input()) 3 | print("la tabla es:") 4 | for i in range (0,10): 5 | multiplicacion = (i+1) * numero 6 | print(str(i+1) + " x "+ str(numero) + " = " + str(multiplicacion) ) 7 | 8 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/multiplos_1.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | for i in range(1500 , 2701 ): 3 | if i % 7 == 0 or i % 5==0 : 4 | print(i) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/numLetras.py: -------------------------------------------------------------------------------- 1 | print("iingrese el texto") 2 | texto = input() 3 | 4 | numeros = 0 5 | letras = 0 6 | for i in texto : 7 | if i.isalpha(): 8 | letras = letras + 1 9 | elif i.isdigit(): 10 | numeros = numeros + 1 11 | 12 | print("el texto ingresado tiene "+str(numeros)+" numeros") 13 | print("el texto ingresado tiene "+str(letras)+" letras") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/omitidor.py: -------------------------------------------------------------------------------- 1 | from typing import final 2 | 3 | 4 | lista = list(range(0,7)) 5 | print(lista) 6 | final = [] 7 | cantidad = len(lista) 8 | for i in range(0,int(lista[-1])): 9 | numero = lista[i] 10 | if numero != 3 : 11 | final.append(lista[i]) 12 | else : 13 | continue 14 | print (final) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/pares_impares.py: -------------------------------------------------------------------------------- 1 | print("INGRESE el numero inicial") 2 | inicial = int(input ()) 3 | print("ingrese el valor final de su serie") 4 | final = int(input()) 5 | pares = [] 6 | impares = [] 7 | rango_usuario = [] 8 | for i in range(inicial,(final + 1)): 9 | numero = i 10 | rango_usuario.append(numero) 11 | print(rango_usuario) 12 | cantidad = len(rango_usuario) 13 | for i in range (0,cantidad): 14 | if (rango_usuario[i] % 2) == 0 : 15 | pares.append(rango_usuario[i]) 16 | else : 17 | impares.append(rango_usuario[i]) 18 | print("hay " + str(len(pares)) + " numeros pares") 19 | print("hay " + str(len(impares)) + " numeros impares") -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/patron.py: -------------------------------------------------------------------------------- 1 | from re import split 2 | 3 | 4 | maximo = 4 5 | for i in range(maximo) : 6 | print(' * ' * (i + 1)) 7 | 8 | 9 | print (' * ' * maximo) 10 | 11 | for i in range(maximo): 12 | print (' * ' * (maximo - i )) 13 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/patron2.py: -------------------------------------------------------------------------------- 1 | ast = "*" 2 | print("ingrese el ancho de E") 3 | ancho = int(input()) 4 | print('*' * (ancho)) 5 | for i in range(0,(ancho-1)) : 6 | print('*') 7 | print('*' * round(0.5*ancho)) 8 | for i in range(0,(ancho - 1)) : 9 | print('*') 10 | print('*' * (ancho)) -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/reloj.py: -------------------------------------------------------------------------------- 1 | print("ingrese las horas") 2 | horas = int(input()) 3 | print("ingrese los minutos") 4 | minutos = int(input()) 5 | print("ingrese los segundos") 6 | segundos = int(input()) 7 | 8 | if horas==23 and minutos==59 and segundos==59 : 9 | print ("0h0m0s") 10 | if minutos==59 and segundos==59 : 11 | horas = horas + 1 12 | print (str(horas)+"h0m0s") 13 | if minutos !=59 and segundos ==59: 14 | minutos = minutos + 1 15 | print (str(horas)+"h"+str(minutos)+"m"+"0s") 16 | if segundos!=59: 17 | segundos = segundos + 1 18 | print (str(horas)+"h"+str(minutos)+"m"+str(segundos)+"s") 19 | 20 | 21 | -------------------------------------------------------------------------------- /Semana2/Reto/Entregas/lunes_2182141/valores.py: -------------------------------------------------------------------------------- 1 | nb1 = int(input("Enter nb1:")) 2 | nb2 = int(input("Enter nb2:")) 3 | nb3 = int(input("Enter nb3:")) 4 | 5 | if nb1 > nb2: 6 | nb1 = nb3 * 2 7 | else: 8 | nb1 = nb1 + 1 9 | if nb2 > nb3: 10 | nb1 = nb1 + nb3 * 3 11 | else: 12 | nb1 = 0 13 | nb3 = nb3 * 2 + nb2 14 | 15 | print(nb1, nb2, nb3) 16 | -------------------------------------------------------------------------------- /Semana2/lunes.2200273/RETO 2.1: -------------------------------------------------------------------------------- 1 | def multiple (valor, multiple): 2 | return True if valor % multiple == 0 else False 3 | 4 | multiples_3=[] 5 | multiples_5=[] 6 | 7 | for i in range(1500, 2700): 8 | 9 | if multiple(i, 3): 10 | multiples_3.append(i) 11 | 12 | if multiple(i, 5): 13 | multiples_5.append(i) 14 | 15 | print ("Los multiples de 3 son:", multiples_3) 16 | print ("\nLos multiples de 5 son:", multiples_5) 17 | 18 | -------------------------------------------------------------------------------- /Semana2/lunes.2200273/Reto2_2GradosCyF.py: -------------------------------------------------------------------------------- 1 | #Convertir de grados Celsius a Fahrenheit o viceversa 2 | Celsius = int(input("Ingrese la cantidad de grados CELSIUS a convertir: ")) 3 | Fahrenheit = 1.8*Celsius+32 4 | Fahrenheit_a = int(input("Ingrese la cantidad de grados FAHRENHEIT a convertir: ")) 5 | Celsius_a = Fahrenheit_a/1.8 - 17.77778 6 | 7 | print(Celsius,"grados Celsius equivalen a",Fahrenheit,"grados Farenheit") 8 | print(Fahrenheit_a, "grados Farenheit equivalen a",Celsius_a,"grados celsius") 9 | -------------------------------------------------------------------------------- /Semana2/lunes.2200273/Reto2_3AdivinaDigito (1).py: -------------------------------------------------------------------------------- 1 | #Adivinar un número de 1 a 9 2 | print("Vamos a adivinar un número de 1 a 9") 3 | Numero_min = 1 4 | Numero_max = 9 5 | import random 6 | numero_aleatorio = random.randint(Numero_min,Numero_max) 7 | numero_escogido = input("Selecciona un número entre" + " " + str(Numero_min) + " " +"y" + " " + str(Numero_max) ) 8 | #El comando random.randint selecciona un número aleatorio entre 1 y 9 en este caso, pues ya los seleccionamos. 9 | 10 | if numero_escogido != numero_aleatorio: 11 | print(input("Selecciona un número entre" + " " + str(Numero_min) + " " +"y" + " " + str(Numero_max) )) 12 | if numero_escogido == numero_aleatorio: 13 | print("Bien adivinado") -------------------------------------------------------------------------------- /Semana2/lunes.2200273/Reto2_4ImprimirDe0A6.py: -------------------------------------------------------------------------------- 1 | numeros = range(7) 2 | print (numeros[0]) 3 | print (numeros[1]) 4 | print (numeros[2]) 5 | print (numeros[4]) 6 | print (numeros[5]) 7 | print (numeros[6]) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Semana2/lunes.2200273/Reto2_5Fibonacci.py: -------------------------------------------------------------------------------- 1 | fibonacci = [0, 1] 2 | 3 | for i in range(1, 49):next = fibonacci[i-1] + fibonacci[i] 4 | fibonacci.append(next) 5 | #El comando append permite agregar elementos a la lista. 6 | print (f'Los primeros 50 elementos de la serie Fibonacci son: {fibonacci}') -------------------------------------------------------------------------------- /Semana2/lunes.2200273/Reto2_6TablaDeMultiplicar.py: -------------------------------------------------------------------------------- 1 | #Pedir un número y multiplicar ese número de 1 a 10 2 | numero = int(input("Selecciona un numero ")) 3 | 4 | for i in range (1,11): 5 | print(f"{i}*{numero} = {i * numero}") 6 | #Es un bucle que se repite desde 1 hasta 10. Luego debemos imprimir la operación i*número hasta 10, y se ponen en corchetes... 7 | #...para que se tome el valor como variable, o, número. -------------------------------------------------------------------------------- /Semana2/lunes.2200273/Reto2_7Invertir.py: -------------------------------------------------------------------------------- 1 | def contador_par_impar(lista): 2 | pares, impares = 0,0 3 | for i in lista: 4 | if i % 2 == 0: 5 | pares += 1 6 | else: 7 | impares += 1 8 | return pares, impares 9 | 10 | 11 | numeros = [1, 2, 3, 4, 5, 6, 7, 9, 10] 12 | resultado = contador_par_impar(numeros) 13 | 14 | print("La cantidad de pares es: %i " % resultado[0]) 15 | print("La cantidad de impares es: %i " % resultado[0]) 16 | 17 | -------------------------------------------------------------------------------- /Semana2/numeros_primos.py: -------------------------------------------------------------------------------- 1 | # INPUT: Dato de entrada es el numero 2 | # 1. Pedir el numero al usuario 3 | numero_ingresado = int(input()) 4 | residuo = numero_ingresado % 2 5 | # 2. Evaluar si es par o impar, usando el operador % 6 | # and 7 | # or 8 | # not 9 | if numero_ingresado < 0 and residuo == 0: 10 | # 3. Mostrar la salida acorde con mi condicion 11 | print("Su numero es par y es negativo") 12 | elif residuo == 0: 13 | print("Su numero es par") 14 | else: 15 | print("Su numero es impar") 16 | 17 | 18 | # QUIERO MOSTRAR "Hi, world." 5 veces 19 | contador = 0 20 | 21 | if contador < 5: 22 | print("Hi, world.") 23 | 24 | # BUCLE INFINITO: la condicion siempre es verdera en este caso 25 | # while contador < 5: 26 | # print("Hi, world.") 27 | 28 | # Mejor sobre escribo una variable para que la condición llegue a ser falsa en el momento en que contador sea 5 29 | while contador < 5: 30 | print("Hi, world.") 31 | contador = contador + 1 32 | 33 | # OUTPUT: "Su numero es par" o "Su numero es impar" 34 | -------------------------------------------------------------------------------- /Semana2/promedio.py: -------------------------------------------------------------------------------- 1 | # PROBLEMA: Quiero un software que calcule el promedio de mis notas del semestre (n cantidad de notas) 2 | # INPUT: Las notas, n cantidad de notas 3 | # 1. Pedir n cantidad de notas 4 | cantidad_de_notas = int(input()) 5 | 6 | if cantidad_de_notas <= 0: 7 | print("Ingrese una cantidad valida") 8 | else: 9 | # 2. Pedir la nota de cada materia 10 | """ 11 | inicializo contador 1 con el fin de actualizarlo con respecto al tiempo y que el bucle se ejecute mientras el contador sea menor o igual a la cantidad de notas ingresadas 12 | """ 13 | contador = 1 14 | """ 15 | inicializo suma como 0 para ir sobre escribiendo esta variable, sumando las notas que ingresa el usuario 16 | """ 17 | suma = 0 18 | 19 | # si el contador es menor o igual a la cantidad de notas, ejecutar el código y volver a evaluar la condicion 20 | while contador <= cantidad_de_notas: 21 | print("Cual es la nota de tu materia " + str(contador)) 22 | nota_ingresada_por_usuario = int(input()) 23 | suma = suma + nota_ingresada_por_usuario 24 | # sobre escribo contador para saber mi iteracion actual 25 | contador = contador + 1 26 | 27 | # 3. Calcular el promedio = suma de todos mis numeros / cantidad 28 | print("Su promedio es " + str(suma / cantidad_de_notas)) 29 | # OUTPUT: Promedio final 30 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Gruposabado_2172116_reto3/1_extraccion_pares.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 5, 6 | "id": "c156e53b", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import numpy as np\n", 11 | "arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])\n" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 6, 17 | "id": "25fd2d9c", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "data": { 22 | "text/plain": [ 23 | "array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])" 24 | ] 25 | }, 26 | "execution_count": 6, 27 | "metadata": {}, 28 | "output_type": "execute_result" 29 | } 30 | ], 31 | "source": [ 32 | "arr" 33 | ] 34 | }, 35 | { 36 | "cell_type": "code", 37 | "execution_count": 9, 38 | "id": "b3607582", 39 | "metadata": {}, 40 | "outputs": [ 41 | { 42 | "data": { 43 | "text/plain": [ 44 | "array([1, 3, 5, 7, 9])" 45 | ] 46 | }, 47 | "execution_count": 9, 48 | "metadata": {}, 49 | "output_type": "execute_result" 50 | } 51 | ], 52 | "source": [ 53 | "arr[arr % 2 != 0]" 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "execution_count": null, 59 | "id": "0f1847eb", 60 | "metadata": {}, 61 | "outputs": [], 62 | "source": [] 63 | } 64 | ], 65 | "metadata": { 66 | "kernelspec": { 67 | "display_name": "Python 3 (ipykernel)", 68 | "language": "python", 69 | "name": "python3" 70 | }, 71 | "language_info": { 72 | "codemirror_mode": { 73 | "name": "ipython", 74 | "version": 3 75 | }, 76 | "file_extension": ".py", 77 | "mimetype": "text/x-python", 78 | "name": "python", 79 | "nbconvert_exporter": "python", 80 | "pygments_lexer": "ipython3", 81 | "version": "3.10.1" 82 | } 83 | }, 84 | "nbformat": 4, 85 | "nbformat_minor": 5 86 | } 87 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Gruposabado_2172116_reto3/2_reemplazar_array.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "8a696baf", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import numpy as np\n", 11 | "arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])\n" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 2, 17 | "id": "031d62fb", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "data": { 22 | "text/plain": [ 23 | "array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])" 24 | ] 25 | }, 26 | "execution_count": 2, 27 | "metadata": {}, 28 | "output_type": "execute_result" 29 | } 30 | ], 31 | "source": [ 32 | "arr" 33 | ] 34 | }, 35 | { 36 | "cell_type": "code", 37 | "execution_count": 4, 38 | "id": "309a81c0", 39 | "metadata": {}, 40 | "outputs": [ 41 | { 42 | "data": { 43 | "text/plain": [ 44 | "array([ 0, -1, 2, -1, 4, -1, 6, -1, 8, -1])" 45 | ] 46 | }, 47 | "execution_count": 4, 48 | "metadata": {}, 49 | "output_type": "execute_result" 50 | } 51 | ], 52 | "source": [ 53 | "np.where(arr % 2 != 0, -1, arr)" 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "execution_count": null, 59 | "id": "33ab5980", 60 | "metadata": {}, 61 | "outputs": [], 62 | "source": [] 63 | } 64 | ], 65 | "metadata": { 66 | "kernelspec": { 67 | "display_name": "Python 3 (ipykernel)", 68 | "language": "python", 69 | "name": "python3" 70 | }, 71 | "language_info": { 72 | "codemirror_mode": { 73 | "name": "ipython", 74 | "version": 3 75 | }, 76 | "file_extension": ".py", 77 | "mimetype": "text/x-python", 78 | "name": "python", 79 | "nbconvert_exporter": "python", 80 | "pygments_lexer": "ipython3", 81 | "version": "3.10.1" 82 | } 83 | }, 84 | "nbformat": 4, 85 | "nbformat_minor": 5 86 | } 87 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Gruposabado_2172116_reto3/4_concadenar_matrices.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "9e31c058", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import numpy as np\n", 11 | "\n", 12 | "a = np.arange(10).reshape(2, -1)\n", 13 | "b = np.repeat(1, 10).reshape(2, -1)\n" 14 | ] 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": 2, 19 | "id": "2a630653", 20 | "metadata": {}, 21 | "outputs": [ 22 | { 23 | "data": { 24 | "text/plain": [ 25 | "array([[0, 1, 2, 3, 4],\n", 26 | " [5, 6, 7, 8, 9]])" 27 | ] 28 | }, 29 | "execution_count": 2, 30 | "metadata": {}, 31 | "output_type": "execute_result" 32 | } 33 | ], 34 | "source": [ 35 | "a" 36 | ] 37 | }, 38 | { 39 | "cell_type": "code", 40 | "execution_count": 3, 41 | "id": "503521c9", 42 | "metadata": {}, 43 | "outputs": [ 44 | { 45 | "data": { 46 | "text/plain": [ 47 | "array([[1, 1, 1, 1, 1],\n", 48 | " [1, 1, 1, 1, 1]])" 49 | ] 50 | }, 51 | "execution_count": 3, 52 | "metadata": {}, 53 | "output_type": "execute_result" 54 | } 55 | ], 56 | "source": [ 57 | "b" 58 | ] 59 | }, 60 | { 61 | "cell_type": "code", 62 | "execution_count": 4, 63 | "id": "e027541e", 64 | "metadata": {}, 65 | "outputs": [ 66 | { 67 | "data": { 68 | "text/plain": [ 69 | "array([[0, 1, 2, 3, 4, 1, 1, 1, 1, 1],\n", 70 | " [5, 6, 7, 8, 9, 1, 1, 1, 1, 1]])" 71 | ] 72 | }, 73 | "execution_count": 4, 74 | "metadata": {}, 75 | "output_type": "execute_result" 76 | } 77 | ], 78 | "source": [ 79 | "np.hstack((a, b))" 80 | ] 81 | }, 82 | { 83 | "cell_type": "code", 84 | "execution_count": null, 85 | "id": "6261b81f", 86 | "metadata": {}, 87 | "outputs": [], 88 | "source": [] 89 | } 90 | ], 91 | "metadata": { 92 | "kernelspec": { 93 | "display_name": "Python 3 (ipykernel)", 94 | "language": "python", 95 | "name": "python3" 96 | }, 97 | "language_info": { 98 | "codemirror_mode": { 99 | "name": "ipython", 100 | "version": 3 101 | }, 102 | "file_extension": ".py", 103 | "mimetype": "text/x-python", 104 | "name": "python", 105 | "nbconvert_exporter": "python", 106 | "pygments_lexer": "ipython3", 107 | "version": "3.10.1" 108 | } 109 | }, 110 | "nbformat": 4, 111 | "nbformat_minor": 5 112 | } 113 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Gruposabado_2172116_reto3/6_elementos_comunes.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 7, 6 | "id": "8b999bc9", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import numpy as np\n", 11 | "\n", 12 | "a = np.array([1,2,3,2,3,4,3,4,5,6])\n", 13 | "b = np.array([7,2,10,2,7,4,9,4,9,8])" 14 | ] 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": 8, 19 | "id": "459a7fc9", 20 | "metadata": {}, 21 | "outputs": [ 22 | { 23 | "data": { 24 | "text/plain": [ 25 | "array([1, 2, 3, 2, 3, 4, 3, 4, 5, 6])" 26 | ] 27 | }, 28 | "execution_count": 8, 29 | "metadata": {}, 30 | "output_type": "execute_result" 31 | } 32 | ], 33 | "source": [ 34 | "a" 35 | ] 36 | }, 37 | { 38 | "cell_type": "code", 39 | "execution_count": 9, 40 | "id": "c02c07a4", 41 | "metadata": {}, 42 | "outputs": [ 43 | { 44 | "data": { 45 | "text/plain": [ 46 | "array([ 7, 2, 10, 2, 7, 4, 9, 4, 9, 8])" 47 | ] 48 | }, 49 | "execution_count": 9, 50 | "metadata": {}, 51 | "output_type": "execute_result" 52 | } 53 | ], 54 | "source": [ 55 | "b" 56 | ] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": 31, 61 | "id": "334b0797", 62 | "metadata": {}, 63 | "outputs": [ 64 | { 65 | "data": { 66 | "text/plain": [ 67 | "array([2, 4])" 68 | ] 69 | }, 70 | "execution_count": 31, 71 | "metadata": {}, 72 | "output_type": "execute_result" 73 | } 74 | ], 75 | "source": [ 76 | "np.intersect1d(a, b)" 77 | ] 78 | }, 79 | { 80 | "cell_type": "code", 81 | "execution_count": null, 82 | "id": "7a82b324", 83 | "metadata": {}, 84 | "outputs": [], 85 | "source": [] 86 | }, 87 | { 88 | "cell_type": "code", 89 | "execution_count": null, 90 | "id": "13c952e9", 91 | "metadata": {}, 92 | "outputs": [], 93 | "source": [] 94 | }, 95 | { 96 | "cell_type": "code", 97 | "execution_count": null, 98 | "id": "504bc605", 99 | "metadata": {}, 100 | "outputs": [], 101 | "source": [] 102 | }, 103 | { 104 | "cell_type": "code", 105 | "execution_count": null, 106 | "id": "695526da", 107 | "metadata": {}, 108 | "outputs": [], 109 | "source": [] 110 | } 111 | ], 112 | "metadata": { 113 | "kernelspec": { 114 | "display_name": "Python 3 (ipykernel)", 115 | "language": "python", 116 | "name": "python3" 117 | }, 118 | "language_info": { 119 | "codemirror_mode": { 120 | "name": "ipython", 121 | "version": 3 122 | }, 123 | "file_extension": ".py", 124 | "mimetype": "text/x-python", 125 | "name": "python", 126 | "nbconvert_exporter": "python", 127 | "pygments_lexer": "ipython3", 128 | "version": "3.10.1" 129 | } 130 | }, 131 | "nbformat": 4, 132 | "nbformat_minor": 5 133 | } 134 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Gruposabado_2172116_reto3/7_posiciondeelementos.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "2f523f15", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import numpy as np\n", 11 | "\n", 12 | "a = np.array([1,2,3,2,3,4,3,4,5,6])\n", 13 | "b = np.array([7,2,10,2,7,4,9,4,9,8])" 14 | ] 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": 2, 19 | "id": "1ce3de6c", 20 | "metadata": {}, 21 | "outputs": [ 22 | { 23 | "data": { 24 | "text/plain": [ 25 | "array([1, 2, 3, 2, 3, 4, 3, 4, 5, 6])" 26 | ] 27 | }, 28 | "execution_count": 2, 29 | "metadata": {}, 30 | "output_type": "execute_result" 31 | } 32 | ], 33 | "source": [ 34 | "a" 35 | ] 36 | }, 37 | { 38 | "cell_type": "code", 39 | "execution_count": 3, 40 | "id": "76fe9658", 41 | "metadata": {}, 42 | "outputs": [ 43 | { 44 | "data": { 45 | "text/plain": [ 46 | "array([ 7, 2, 10, 2, 7, 4, 9, 4, 9, 8])" 47 | ] 48 | }, 49 | "execution_count": 3, 50 | "metadata": {}, 51 | "output_type": "execute_result" 52 | } 53 | ], 54 | "source": [ 55 | "b" 56 | ] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": 4, 61 | "id": "bbe58874", 62 | "metadata": {}, 63 | "outputs": [ 64 | { 65 | "data": { 66 | "text/plain": [ 67 | "(array([1, 3, 5, 7], dtype=int64),)" 68 | ] 69 | }, 70 | "execution_count": 4, 71 | "metadata": {}, 72 | "output_type": "execute_result" 73 | } 74 | ], 75 | "source": [ 76 | "np.where(a == b)" 77 | ] 78 | }, 79 | { 80 | "cell_type": "code", 81 | "execution_count": null, 82 | "id": "9deac314", 83 | "metadata": {}, 84 | "outputs": [], 85 | "source": [] 86 | } 87 | ], 88 | "metadata": { 89 | "kernelspec": { 90 | "display_name": "Python 3 (ipykernel)", 91 | "language": "python", 92 | "name": "python3" 93 | }, 94 | "language_info": { 95 | "codemirror_mode": { 96 | "name": "ipython", 97 | "version": 3 98 | }, 99 | "file_extension": ".py", 100 | "mimetype": "text/x-python", 101 | "name": "python", 102 | "nbconvert_exporter": "python", 103 | "pygments_lexer": "ipython3", 104 | "version": "3.10.1" 105 | } 106 | }, 107 | "nbformat": 4, 108 | "nbformat_minor": 5 109 | } 110 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Gruposabado_2172116_reto3/8_extracion_rango.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "b53d9044", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import numpy as np\n", 11 | "a = np.array([2, 6, 1, 9, 10, 3, 27])" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 10, 17 | "id": "44bd4639", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "data": { 22 | "text/plain": [ 23 | "array([ 3, 27])" 24 | ] 25 | }, 26 | "execution_count": 10, 27 | "metadata": {}, 28 | "output_type": "execute_result" 29 | } 30 | ], 31 | "source": [ 32 | "a[5:10]" 33 | ] 34 | }, 35 | { 36 | "cell_type": "code", 37 | "execution_count": 13, 38 | "id": "d1bddaf1", 39 | "metadata": {}, 40 | "outputs": [ 41 | { 42 | "data": { 43 | "text/plain": [ 44 | "array([ 6, 9, 10])" 45 | ] 46 | }, 47 | "execution_count": 13, 48 | "metadata": {}, 49 | "output_type": "execute_result" 50 | } 51 | ], 52 | "source": [ 53 | "a[(a >= 5) & (a <= 10)]" 54 | ] 55 | }, 56 | { 57 | "cell_type": "code", 58 | "execution_count": null, 59 | "id": "b94832a5", 60 | "metadata": {}, 61 | "outputs": [], 62 | "source": [] 63 | } 64 | ], 65 | "metadata": { 66 | "kernelspec": { 67 | "display_name": "Python 3 (ipykernel)", 68 | "language": "python", 69 | "name": "python3" 70 | }, 71 | "language_info": { 72 | "codemirror_mode": { 73 | "name": "ipython", 74 | "version": 3 75 | }, 76 | "file_extension": ".py", 77 | "mimetype": "text/x-python", 78 | "name": "python", 79 | "nbconvert_exporter": "python", 80 | "pygments_lexer": "ipython3", 81 | "version": "3.10.1" 82 | } 83 | }, 84 | "nbformat": 4, 85 | "nbformat_minor": 5 86 | } 87 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Lunes_2200262_Reto3/Reto3_1ExtraerNumeros.ipynb.ipynb: -------------------------------------------------------------------------------- 1 | {"cells":[{"metadata":{"trusted":true},"cell_type":"code","source":"import numpy as np","execution_count":1,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"arr = np.array([0,1,2,3,4,5,6,7,8,9])","execution_count":2,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"arr[arr % 2 == 1]","execution_count":3,"outputs":[{"output_type":"execute_result","execution_count":3,"data":{"text/plain":"array([1, 3, 5, 7, 9])"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.6.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":5} -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Lunes_2200262_Reto3/Reto3_2CambiarElementos.ipynb.ipynb: -------------------------------------------------------------------------------- 1 | {"cells":[{"metadata":{"trusted":true},"cell_type":"code","source":"import numpy as np","execution_count":1,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])","execution_count":2,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"np.where(arr % 2 == 1, -1, arr)","execution_count":3,"outputs":[{"output_type":"execute_result","execution_count":3,"data":{"text/plain":"array([ 0, -1, 2, -1, 4, -1, 6, -1, 8, -1])"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.6.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":5} -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Lunes_2200262_Reto3/Reto3_3ApilarMatrices.ipynb.ipynb: -------------------------------------------------------------------------------- 1 | {"cells":[{"metadata":{"trusted":true},"cell_type":"code","source":"import numpy as np","execution_count":1,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"a = np.arange(10).reshape(2,-1)","execution_count":2,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"b = np.repeat(1,10).reshape(2,-1)","execution_count":3,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"#vstack nos permite apilar directamente 2 matrices de forma vertical.","execution_count":4,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"np.vstack([a,b])","execution_count":5,"outputs":[{"output_type":"execute_result","execution_count":5,"data":{"text/plain":"array([[0, 1, 2, 3, 4],\n [5, 6, 7, 8, 9],\n [1, 1, 1, 1, 1],\n [1, 1, 1, 1, 1]])"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.6.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":5} -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Lunes_2200262_Reto3/Reto3_4ApilarHorizontal.ipynb.ipynb: -------------------------------------------------------------------------------- 1 | {"cells":[{"metadata":{"trusted":true},"cell_type":"code","source":"import numpy as np ","execution_count":1,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"a = np.arange(10).reshape(2,-1)","execution_count":2,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"b = np.repeat(1,10).reshape(2,-1)","execution_count":3,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"#El comando hstack permite directamente apilar 2 matrices de forma horizontal","execution_count":4,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"np.hstack([a,b])","execution_count":5,"outputs":[{"output_type":"execute_result","execution_count":5,"data":{"text/plain":"array([[0, 1, 2, 3, 4, 1, 1, 1, 1, 1],\n [5, 6, 7, 8, 9, 1, 1, 1, 1, 1]])"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.6.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":5} -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Lunes_2200262_Reto3/Reto3_5ElementosComunes.ipynb.ipynb: -------------------------------------------------------------------------------- 1 | {"cells":[{"metadata":{"trusted":true},"cell_type":"code","source":"import numpy as np","execution_count":1,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"a = np.array([1,2,3,2,3,4,3,4,5,6])","execution_count":2,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"b = np.array([7,2,10,2,7,4,9,4,9,8])","execution_count":10,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"np.intersect1d(a,b)","execution_count":11,"outputs":[{"output_type":"execute_result","execution_count":11,"data":{"text/plain":"array([2, 4])"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"#Con el comando intersect1d podemos encontrar los elementos comunes entre 2 arrays","execution_count":12,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.6.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":5} -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Lunes_2200262_Reto3/Reto3_6NumerosRango.ipynb.ipynb: -------------------------------------------------------------------------------- 1 | {"cells":[{"metadata":{"trusted":true},"cell_type":"code","source":"import numpy as np","execution_count":1,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"a = np.array([2, 6, 1, 9, 10, 3, 27])","execution_count":2,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"Numero = np.where((a > 5) & (a <= 10))","execution_count":7,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"a[Numero]","execution_count":8,"outputs":[{"output_type":"execute_result","execution_count":8,"data":{"text/plain":"array([ 6, 9, 10])"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.6.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":5} -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Lunes_2200262_Reto3/Reto3_7PosicionesIguaes.ipynb.ipynb: -------------------------------------------------------------------------------- 1 | {"cells":[{"metadata":{"trusted":true},"cell_type":"code","source":"import numpy as np","execution_count":2,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"a = np.array([1,2,3,2,3,4,3,4,5,6])","execution_count":3,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"b = np.array([7,2,10,2,7,4,9,4,9,8])","execution_count":4,"outputs":[]},{"metadata":{"trusted":true},"cell_type":"code","source":"np.where(a == b)","execution_count":8,"outputs":[{"output_type":"execute_result","execution_count":8,"data":{"text/plain":"(array([1, 3, 5, 7]),)"},"metadata":{}}]},{"metadata":{"trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.6.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":5} -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Lunes_2200262_Reto3/Reto3_8Secuencia.ipynb.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "12c22a8a", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import numpy as np" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 2, 16 | "id": "97be26de", 17 | "metadata": {}, 18 | "outputs": [], 19 | "source": [ 20 | "a = np.array([1,2,3])" 21 | ] 22 | }, 23 | { 24 | "cell_type": "code", 25 | "execution_count": 35, 26 | "id": "12bddf9c", 27 | "metadata": {}, 28 | "outputs": [ 29 | { 30 | "data": { 31 | "text/plain": [ 32 | "array([1, 1, 1, 2, 2, 2, 3, 3, 3])" 33 | ] 34 | }, 35 | "execution_count": 35, 36 | "metadata": {}, 37 | "output_type": "execute_result" 38 | } 39 | ], 40 | "source": [ 41 | "b = np.repeat(a, 3)" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": 40, 47 | "id": "28c7dae0", 48 | "metadata": {}, 49 | "outputs": [ 50 | { 51 | "data": { 52 | "text/plain": [ 53 | "array([1, 2, 3, 1, 2, 3, 1, 2, 3])" 54 | ] 55 | }, 56 | "execution_count": 40, 57 | "metadata": {}, 58 | "output_type": "execute_result" 59 | } 60 | ], 61 | "source": [ 62 | "c = np.tile(a, 3)" 63 | ] 64 | }, 65 | { 66 | "cell_type": "code", 67 | "execution_count": 56, 68 | "id": "b0d24217", 69 | "metadata": {}, 70 | "outputs": [ 71 | { 72 | "name": "stdout", 73 | "output_type": "stream", 74 | "text": [ 75 | "[(1, 1, 1)] [1 2 3 1 2 3 1 2 3]\n" 76 | ] 77 | } 78 | ], 79 | "source": [ 80 | "print(b,c)" 81 | ] 82 | }, 83 | { 84 | "cell_type": "code", 85 | "execution_count": null, 86 | "id": "2c2f7539", 87 | "metadata": {}, 88 | "outputs": [], 89 | "source": [] 90 | } 91 | ], 92 | "metadata": { 93 | "kernelspec": { 94 | "display_name": "Python 3 (ipykernel)", 95 | "language": "python", 96 | "name": "python3" 97 | }, 98 | "language_info": { 99 | "codemirror_mode": { 100 | "name": "ipython", 101 | "version": 3 102 | }, 103 | "file_extension": ".py", 104 | "mimetype": "text/x-python", 105 | "name": "python", 106 | "nbconvert_exporter": "python", 107 | "pygments_lexer": "ipython3", 108 | "version": "3.9.4" 109 | } 110 | }, 111 | "nbformat": 4, 112 | "nbformat_minor": 5 113 | } 114 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/README.md: -------------------------------------------------------------------------------- 1 | # Carpeta de entregas de la Semana 3 2 | 3 | Acá es donde debe subir la carpeta con sus retos según lo indicado en el vídeo del [acá en el aula virtual](https://drive.google.com/file/d/1rY_XUXCMwqY3chPxq7QMhZSd6tIs5pBd/view?usp=sharing) 4 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Reto 3/Sabado_2184609/Apilar_Matrices_Horizontales.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | a = np.arange(10).reshape(2,-1) 3 | b = np.repeat(1, 10).reshape(2,-1) 4 | 5 | print(np.hstack((a,b))) 6 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Reto 3/Sabado_2184609/Apilar_Matrices_Verticales.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | a = np.arange(10).reshape(2,-1) 3 | b = np.repeat(1, 10).reshape(2,-1) 4 | 5 | print(np.vstack((a,b))) 6 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Reto 3/Sabado_2184609/Elementos_comunes.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | a = np.array([1,2,3,2,3,4,3,4,5,6]) 4 | b = np.array ([7,2,10,2,7,4,9,4,9,8]) 5 | 6 | print(np.intersect1d(a,b)) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Reto 3/Sabado_2184609/Extraer_Elementos_Comunes.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) 4 | 5 | filtered_arr = [] 6 | 7 | for element in arr: 8 | if element % 2 == 0: 9 | filtered_arr.append(False) 10 | else: 11 | filtered_arr.append(True) 12 | 13 | print(arr[filtered_arr]) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Reto 3/Sabado_2184609/Extraer_Elementos_Rango.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | arr = np.array([2,6,1,9,10,3,27]) 4 | 5 | filtered_arr = [] 6 | 7 | for element in arr: 8 | if element >= 5 and element <= 10: 9 | filtered_arr.append(True) 10 | else: 11 | filtered_arr.append(False) 12 | 13 | print(arr[filtered_arr]) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Reto 3/Sabado_2184609/Generar_Array_Tramos.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | def funcion_a(x): 4 | return 1 / 3 * (x ** 2) - 20 5 | 6 | def funcion_b(x): 7 | return -1 / 3 * x + 5 8 | 9 | def funcion_c(x): 10 | return -5 * x + 2 11 | 12 | x = np.arange(0,500,1) 13 | 14 | r = np.piecewise(x, [x <= 100, (x > 100) & (x <= 350), (x > 350) & (x <= 500)], [lambda x: funcion_a(x), lambda x: funcion_b(x), lambda x: funcion_c(x)]) 15 | print(r) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Reto 3/Sabado_2184609/Posicion_Elementos_Comunes.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | a = np.array([1,2,3,2,3,4,3,4,5,6]) 4 | b = np.array ([7,2,10,2,7,4,9,4,9,8]) 5 | arr1 = np.in1d(a,b) 6 | result = np.where(arr1 == True) 7 | print(result[0]) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Reto 3/Sabado_2184609/Reemplazar_Elementos_Array.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) 4 | print(np.where(arr % 2 == 0, arr, -1)) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Reto 3/Sabado_2184609/Secuencias.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | a = np.array([1, 2, 3]) 4 | 5 | parte1 = np.repeat(a, 3) 6 | parte2 = np.tile(a, 3) 7 | print(np.hstack((parte1,parte2))) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2184607/apilar_dos_matrices_horizontal.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | a = np.arange(10).reshape(2,-1) 3 | b = np.repeat(1, 10).reshape(2,-1) 4 | 5 | print(np.hstack((a,b))) 6 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2184607/apilar_dos_matrices_vertical copy.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | a = np.arange(10).reshape(2,-1) 3 | b = np.repeat(1, 10).reshape(2,-1) 4 | 5 | print(np.vstack((a,b))) 6 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2184607/elementos_comunes.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | a = np.array([1,2,3,2,3,4,3,4,5,6]) 4 | b = np.array ([7,2,10,2,7,4,9,4,9,8]) 5 | 6 | print(np.intersect1d(a,b)) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2184607/extraer_elementos_condicion.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) 4 | 5 | filtered_arr = [] 6 | 7 | for element in arr: 8 | if element % 2 == 0: 9 | filtered_arr.append(False) 10 | else: 11 | filtered_arr.append(True) 12 | 13 | print(arr[filtered_arr]) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2184607/extraer_elementos_rango.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | arr = np.array([2,6,1,9,10,3,27]) 4 | 5 | filtered_arr = [] 6 | 7 | for element in arr: 8 | if element >= 5 and element <= 10: 9 | filtered_arr.append(True) 10 | else: 11 | filtered_arr.append(False) 12 | 13 | print(arr[filtered_arr]) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2184607/generar_array_por_tramos.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | def funcion_a(x): 4 | return 1 / 3 * (x ** 2) - 20 5 | 6 | def funcion_b(x): 7 | return -1 / 3 * x + 5 8 | 9 | def funcion_c(x): 10 | return -5 * x + 2 11 | 12 | x = np.arange(0,500,1) 13 | 14 | r = np.piecewise(x, [x <= 100, (x > 100) & (x <= 350), (x > 350) & (x <= 500)], [lambda x: funcion_a(x), lambda x: funcion_b(x), lambda x: funcion_c(x)]) 15 | print(r) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2184607/posiciones_aquellos_comunes.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | a = np.array([1,2,3,2,3,4,3,4,5,6]) 4 | b = np.array ([7,2,10,2,7,4,9,4,9,8]) 5 | arr1 = np.in1d(a,b) 6 | result = np.where(arr1 == True) 7 | print(result[0]) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2184607/reemplazar_elementos_array.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) 4 | print(np.where(arr % 2 == 0, arr, -1)) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2184607/secuencias.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | a = np.array([1, 2, 3]) 4 | 5 | parte1 = np.repeat(a, 3) 6 | parte2 = np.tile(a, 3) 7 | print(np.hstack((parte1,parte2))) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2200269/#Elementos_comunes.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "a3ff561d", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import numpy as np" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 4, 16 | "id": "0c9f2a3d", 17 | "metadata": {}, 18 | "outputs": [ 19 | { 20 | "data": { 21 | "text/plain": [ 22 | "(array([1, 3, 5, 7], dtype=int64),)" 23 | ] 24 | }, 25 | "execution_count": 4, 26 | "metadata": {}, 27 | "output_type": "execute_result" 28 | } 29 | ], 30 | "source": [ 31 | "a = np.array([1,2,3,2,3,4,3,4,5,6])\n", 32 | "b = np.array([7,2,10,2,7,4,9,4,9,8])\n", 33 | "\n", 34 | "#Usar la función where(condición que se debe cumplir) para encontrar la posición de los números en común de los array\n", 35 | "np.where(a == b)\n" 36 | ] 37 | } 38 | ], 39 | "metadata": { 40 | "kernelspec": { 41 | "display_name": "Python 3 (ipykernel)", 42 | "language": "python", 43 | "name": "python3" 44 | }, 45 | "language_info": { 46 | "codemirror_mode": { 47 | "name": "ipython", 48 | "version": 3 49 | }, 50 | "file_extension": ".py", 51 | "mimetype": "text/x-python", 52 | "name": "python", 53 | "nbconvert_exporter": "python", 54 | "pygments_lexer": "ipython3", 55 | "version": "3.9.6" 56 | } 57 | }, 58 | "nbformat": 4, 59 | "nbformat_minor": 5 60 | } 61 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2200269/Apilar_matrices_horizontalmente.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "27831bfc", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "#Importar el modulo\n", 11 | "import numpy as np " 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 3, 17 | "id": "46288ff1", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "data": { 22 | "text/plain": [ 23 | "array([[0, 1, 2, 3, 4, 1, 1, 1, 1, 1],\n", 24 | " [5, 6, 7, 8, 9, 1, 1, 1, 1, 1]])" 25 | ] 26 | }, 27 | "execution_count": 3, 28 | "metadata": {}, 29 | "output_type": "execute_result" 30 | } 31 | ], 32 | "source": [ 33 | "#Definir las variables con las matrices, la primera esta compuesta por números del 0 al 9, mientras que la segunda se compone del número 1 10 veces\n", 34 | "a = np.arange(10).reshape(2,-1)\n", 35 | "b = np.repeat(1, 10).reshape(2,-1)\n", 36 | "np.hstack((a,b))" 37 | ] 38 | } 39 | ], 40 | "metadata": { 41 | "kernelspec": { 42 | "display_name": "Python 3 (ipykernel)", 43 | "language": "python", 44 | "name": "python3" 45 | }, 46 | "language_info": { 47 | "codemirror_mode": { 48 | "name": "ipython", 49 | "version": 3 50 | }, 51 | "file_extension": ".py", 52 | "mimetype": "text/x-python", 53 | "name": "python", 54 | "nbconvert_exporter": "python", 55 | "pygments_lexer": "ipython3", 56 | "version": "3.9.6" 57 | } 58 | }, 59 | "nbformat": 4, 60 | "nbformat_minor": 5 61 | } 62 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2200269/Apilar_matrices_verticalmente.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 7, 6 | "id": "97fb21d8", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "#Importar el modulo\n", 11 | "import numpy as np" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 24, 17 | "id": "c3a01d66", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "data": { 22 | "text/plain": [ 23 | "array([[0, 1, 2, 3, 4],\n", 24 | " [5, 6, 7, 8, 9],\n", 25 | " [1, 1, 1, 1, 1],\n", 26 | " [1, 1, 1, 1, 1]])" 27 | ] 28 | }, 29 | "execution_count": 24, 30 | "metadata": {}, 31 | "output_type": "execute_result" 32 | } 33 | ], 34 | "source": [ 35 | "#Definir las variables con las matrices, la primera esta compuesta por números del 0 al 9, mientras que la segunda se compone del número 1 10 veces\n", 36 | "a = np.arange(10).reshape(2,-1)\n", 37 | "b = np.repeat(1, 10).reshape(2,-1)\n", 38 | "np.concatenate((a,b))" 39 | ] 40 | } 41 | ], 42 | "metadata": { 43 | "kernelspec": { 44 | "display_name": "Python 3 (ipykernel)", 45 | "language": "python", 46 | "name": "python3" 47 | }, 48 | "language_info": { 49 | "codemirror_mode": { 50 | "name": "ipython", 51 | "version": 3 52 | }, 53 | "file_extension": ".py", 54 | "mimetype": "text/x-python", 55 | "name": "python", 56 | "nbconvert_exporter": "python", 57 | "pygments_lexer": "ipython3", 58 | "version": "3.9.6" 59 | } 60 | }, 61 | "nbformat": 4, 62 | "nbformat_minor": 5 63 | } 64 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2200269/Elementos comunes.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 2, 6 | "id": "934b1ffc", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import numpy as np" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 10, 16 | "id": "178fa72f", 17 | "metadata": {}, 18 | "outputs": [ 19 | { 20 | "name": "stdout", 21 | "output_type": "stream", 22 | "text": [ 23 | "[2 4]\n" 24 | ] 25 | } 26 | ], 27 | "source": [ 28 | "a = np.array([1,2,3,2,3,4,3,4,5,6])\n", 29 | "b = np.array([7,2,10,2,7,4,9,4,9,8])\n", 30 | "\n", 31 | "#Usar la función intersect1d(array 1, array 2) para encontrar los números en común\n", 32 | "print(np.intersect1d(a,b))\n" 33 | ] 34 | } 35 | ], 36 | "metadata": { 37 | "kernelspec": { 38 | "display_name": "Python 3 (ipykernel)", 39 | "language": "python", 40 | "name": "python3" 41 | }, 42 | "language_info": { 43 | "codemirror_mode": { 44 | "name": "ipython", 45 | "version": 3 46 | }, 47 | "file_extension": ".py", 48 | "mimetype": "text/x-python", 49 | "name": "python", 50 | "nbconvert_exporter": "python", 51 | "pygments_lexer": "ipython3", 52 | "version": "3.9.6" 53 | } 54 | }, 55 | "nbformat": 4, 56 | "nbformat_minor": 5 57 | } 58 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2200269/Elementos_condiciones.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 3, 6 | "id": "f66cce38", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "#Importar modulo numpy\n", 11 | "import numpy as np" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 10, 17 | "id": "8382327d", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "data": { 22 | "text/plain": [ 23 | "array([1, 3, 5, 7, 9])" 24 | ] 25 | }, 26 | "execution_count": 10, 27 | "metadata": {}, 28 | "output_type": "execute_result" 29 | } 30 | ], 31 | "source": [ 32 | "#Crear el vector\n", 33 | "arr = np.array([0,1,2,3,4,5,6,7,8,9])\n", 34 | "\n", 35 | "#Crear una lista vacia\n", 36 | "arr2 = []\n", 37 | "\n", 38 | "#Utilizar condicionales para determinar que valores del vector son impares\n", 39 | "for i in arr:\n", 40 | " if i % 2 == 1:\n", 41 | " \n", 42 | " #Agrupor los valores impares en la lista vacia\n", 43 | " arr2.append(i)\n", 44 | "\n", 45 | "#Volver la lista un array \n", 46 | "np.array(arr2)" 47 | ] 48 | } 49 | ], 50 | "metadata": { 51 | "kernelspec": { 52 | "display_name": "Python 3 (ipykernel)", 53 | "language": "python", 54 | "name": "python3" 55 | }, 56 | "language_info": { 57 | "codemirror_mode": { 58 | "name": "ipython", 59 | "version": 3 60 | }, 61 | "file_extension": ".py", 62 | "mimetype": "text/x-python", 63 | "name": "python", 64 | "nbconvert_exporter": "python", 65 | "pygments_lexer": "ipython3", 66 | "version": "3.9.6" 67 | } 68 | }, 69 | "nbformat": 4, 70 | "nbformat_minor": 5 71 | } 72 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2200269/Extraer_elementos_dentro_de_un_rango.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "dc4709a3", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import numpy as np" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 3, 16 | "id": "eebb34ec", 17 | "metadata": {}, 18 | "outputs": [ 19 | { 20 | "name": "stdout", 21 | "output_type": "stream", 22 | "text": [ 23 | "[6, 9, 10]\n" 24 | ] 25 | } 26 | ], 27 | "source": [ 28 | "a = np.array([2, 6, 1, 9, 10, 3, 27])\n", 29 | "\n", 30 | "#Crear una lista vacia para agrupar los valores dentro del rango\n", 31 | "Lista = []\n", 32 | "#Utilizar un bucle junto a un condicional para obtener las entradas que se encuentran entre el rango de 5 a 10\n", 33 | "for i in a:\n", 34 | " if 5<=i<=10:\n", 35 | " Lista.append(i)\n", 36 | "print(Lista)\n", 37 | " " 38 | ] 39 | } 40 | ], 41 | "metadata": { 42 | "kernelspec": { 43 | "display_name": "Python 3 (ipykernel)", 44 | "language": "python", 45 | "name": "python3" 46 | }, 47 | "language_info": { 48 | "codemirror_mode": { 49 | "name": "ipython", 50 | "version": 3 51 | }, 52 | "file_extension": ".py", 53 | "mimetype": "text/x-python", 54 | "name": "python", 55 | "nbconvert_exporter": "python", 56 | "pygments_lexer": "ipython3", 57 | "version": "3.9.6" 58 | } 59 | }, 60 | "nbformat": 4, 61 | "nbformat_minor": 5 62 | } 63 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2200269/Matrix_slicing_1.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 2, 6 | "id": "4e545d2a", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import numpy as np" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 8, 16 | "id": "730a398d", 17 | "metadata": {}, 18 | "outputs": [ 19 | { 20 | "name": "stdout", 21 | "output_type": "stream", 22 | "text": [ 23 | "MATRIZ ORIGINAL 1\n", 24 | "[[ 1 2 3 4 5]\n", 25 | " [ 6 7 8 9 10]\n", 26 | " [11 12 13 14 15]\n", 27 | " [16 17 18 19 20]\n", 28 | " [21 22 23 24 25]\n", 29 | " [26 27 28 29 30]]\n", 30 | "\n", 31 | "MATRIZ AZUL\n", 32 | "[[11 12]\n", 33 | " [16 17]]\n", 34 | "\n", 35 | "MATRIZ ROJA\n", 36 | "[[ 4 5]\n", 37 | " [24 25]\n", 38 | " [29 30]]\n", 39 | "\n", 40 | "MATRIZ VERDE\n", 41 | "[ 2 8 14 20]\n" 42 | ] 43 | } 44 | ], 45 | "source": [ 46 | "#Crear un vector con los valores de 1 a 30 mediante la función arange() y redistribuir dichos valores formando una matriz de 6x5 usando la función reshape()\n", 47 | "print(\"MATRIZ ORIGINAL 1\")\n", 48 | "Matriz = np.arange(1,31).reshape(6,5)\n", 49 | "\n", 50 | "#obtener submatrices usando slicing, se debe tener en cuenta que termina una columna o fila antes de la indicada\n", 51 | "print(Matriz)\n", 52 | "print()\n", 53 | "\n", 54 | "#Matriz azul\n", 55 | "print(\"MATRIZ AZUL\")\n", 56 | "print(Matriz[2:4,0:2])\n", 57 | "print()\n", 58 | "\n", 59 | "#Matriz roja: Para esta matriz utilizaré la función vstack ya que una de las filas esta separada de la otra\n", 60 | "print(\"MATRIZ ROJA\")\n", 61 | "a = Matriz[0,3:5]\n", 62 | "b = Matriz[4:6,3:5]\n", 63 | "print(np.vstack((a,b)))\n", 64 | "print()\n", 65 | "\n", 66 | "#Matriz verde: En este caso utilizaré la función hstack con el fin de apilar las matrices de manera horizontal\n", 67 | "print(\"MATRIZ VERDE\")\n", 68 | "a = Matriz[0,1]\n", 69 | "b = Matriz[1,2]\n", 70 | "c = Matriz[2,3]\n", 71 | "d = Matriz[3,4]\n", 72 | "print(np.hstack((a,b,c,d)))" 73 | ] 74 | } 75 | ], 76 | "metadata": { 77 | "kernelspec": { 78 | "display_name": "Python 3 (ipykernel)", 79 | "language": "python", 80 | "name": "python3" 81 | }, 82 | "language_info": { 83 | "codemirror_mode": { 84 | "name": "ipython", 85 | "version": 3 86 | }, 87 | "file_extension": ".py", 88 | "mimetype": "text/x-python", 89 | "name": "python", 90 | "nbconvert_exporter": "python", 91 | "pygments_lexer": "ipython3", 92 | "version": "3.9.6" 93 | } 94 | }, 95 | "nbformat": 4, 96 | "nbformat_minor": 5 97 | } 98 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2200269/Patrón_de_caracteres.py: -------------------------------------------------------------------------------- 1 | #Input: Insertar caracter para formar el patrón 2 | P = " *" 3 | #Código: utilizar el comando "for" y "range" para definir lo valores de las variables i, j y u 4 | for i in range(1,4): 5 | N = i 6 | print(N*P) 7 | 8 | for j in range(4,7): 9 | print(4*P) 10 | # En el último tramo de "range" utilizo también "if", "elif" y else, ya que necesito posicionar el caracter de 3 maneras distintas. 11 | for u in range(7,10): 12 | if u == 7: 13 | print(3*P) 14 | elif u == 8: 15 | print(2*P) 16 | else: 17 | print(P) 18 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2200269/Reemplazar_elementos_array.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "a4950225", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "#Importar modulo numpy\n", 11 | "import numpy as np" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 5, 17 | "id": "07e6ac71", 18 | "metadata": {}, 19 | "outputs": [ 20 | { 21 | "data": { 22 | "text/plain": [ 23 | "array([ 0, -1, -2, -3, -4, -5, -6, -7, -8, -9])" 24 | ] 25 | }, 26 | "execution_count": 5, 27 | "metadata": {}, 28 | "output_type": "execute_result" 29 | } 30 | ], 31 | "source": [ 32 | "#Crear array\n", 33 | "arr = np.array([0,1,2,3,4,5,6,7,8,9])\n", 34 | "\n", 35 | "#Crear una lista vacia\n", 36 | "arr2 = []\n", 37 | "\n", 38 | "#Utilizar condicionales para reemplazar variables\n", 39 | "for i in arr:\n", 40 | " \n", 41 | " #Crear una lista con los nuevo valores\n", 42 | " arr2.append(-i)\n", 43 | " \n", 44 | "#Convertir la lista en un array\n", 45 | "np.array(arr2)" 46 | ] 47 | } 48 | ], 49 | "metadata": { 50 | "kernelspec": { 51 | "display_name": "Python 3 (ipykernel)", 52 | "language": "python", 53 | "name": "python3" 54 | }, 55 | "language_info": { 56 | "codemirror_mode": { 57 | "name": "ipython", 58 | "version": 3 59 | }, 60 | "file_extension": ".py", 61 | "mimetype": "text/x-python", 62 | "name": "python", 63 | "nbconvert_exporter": "python", 64 | "pygments_lexer": "ipython3", 65 | "version": "3.9.6" 66 | } 67 | }, 68 | "nbformat": 4, 69 | "nbformat_minor": 5 70 | } 71 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/Sábado_2200269/Secuencias.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "d11310dc", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import numpy as np" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 30, 16 | "id": "8bd449f9", 17 | "metadata": {}, 18 | "outputs": [ 19 | { 20 | "data": { 21 | "text/plain": [ 22 | "array([1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3])" 23 | ] 24 | }, 25 | "execution_count": 30, 26 | "metadata": {}, 27 | "output_type": "execute_result" 28 | } 29 | ], 30 | "source": [ 31 | "a = np.array([1,2,3])\n", 32 | "\n", 33 | "#Utilizar repeat para repetir la primera, segunda y tercera entrada del vector 3 veces cada una\n", 34 | "A = np.repeat(a[0],3)\n", 35 | "B = np.repeat(a[1],3)\n", 36 | "C = np.repeat(a[2],3)\n", 37 | "\n", 38 | "#Utilizar repeat para repetir el vector 3 veces\n", 39 | "D = np.tile(a,3)\n", 40 | "\n", 41 | "#Para unir todo en un mismo array utilizaré hstack\n", 42 | "np.hstack((A,B,C,D))" 43 | ] 44 | }, 45 | { 46 | "cell_type": "code", 47 | "execution_count": null, 48 | "id": "e15d4749", 49 | "metadata": {}, 50 | "outputs": [], 51 | "source": [ 52 | "\n", 53 | "\n" 54 | ] 55 | } 56 | ], 57 | "metadata": { 58 | "kernelspec": { 59 | "display_name": "Python 3 (ipykernel)", 60 | "language": "python", 61 | "name": "python3" 62 | }, 63 | "language_info": { 64 | "codemirror_mode": { 65 | "name": "ipython", 66 | "version": 3 67 | }, 68 | "file_extension": ".py", 69 | "mimetype": "text/x-python", 70 | "name": "python", 71 | "nbconvert_exporter": "python", 72 | "pygments_lexer": "ipython3", 73 | "version": "3.9.6" 74 | } 75 | }, 76 | "nbformat": 4, 77 | "nbformat_minor": 5 78 | } 79 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/lunes_2182141/apilar.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | a = np.arange(10).reshape(2,-1) 3 | b = np.repeat(1, 10).reshape(2,-1) 4 | print(a) 5 | print(b) 6 | print(np.concatenate((a,b),axis=0)) 7 | print(np.concatenate((a,b),axis=1)) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/lunes_2182141/arrayTramos.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | x = np.arange(0,501,10) 3 | print(x) 4 | 5 | x_1 = x[x <= 100] 6 | print(x_1) 7 | y_1 = 1 / 3 * (x_1 ** 2) - 20 8 | print(y_1) 9 | 10 | x_2 = x[(x >= 100) & (x <= 350)] 11 | print(x_2) 12 | y_2 = - 1 / 3* x_2 + 5 13 | print(y_2) 14 | 15 | x_3 = x[(x >= 350) & (x <= 500)] 16 | print(x_3) 17 | y_3 = - 5 * x_3 + 2 18 | print(y_3) 19 | 20 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/lunes_2182141/ejer0.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) 4 | print (arr) 5 | filtro = arr[arr%2 != 0] 6 | print(filtro) 7 | 8 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/lunes_2182141/ejer1.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib as plt 3 | matriz = np.array([ 4 | [2, 6, 1], 5 | [1, 2, -1], 6 | [5, 7, -4] 7 | ]) 8 | solucion = np.array([7, -1, 9]) 9 | print(matriz) 10 | print(solucion) 11 | incog = np.linalg.solve(matriz,solucion) 12 | print(incog) 13 | eje_x = np.arange(0,6) 14 | eje_y = np.arange(3,9) 15 | plt.scatter(eje_x,eje_y) 16 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/lunes_2182141/elemComunes.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | a = np.array([1,2,3,2,3,4,3,4,5,6]) 3 | b = np.array([7,2,10,2,7,4,9,4,9,8]) 4 | c = np.intersect1d(a,b) 5 | print(c) 6 | 7 | print(np.concatenate(( np.where(a == 2) , np.where(a == 4) ),axis=1)) 8 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/lunes_2182141/elementRango.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | a = np.array([2, 6, 1, 9, 10, 3, 27]) 3 | b = np.arange(5,11) 4 | print (np.intersect1d(a,b)) 5 | -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/lunes_2182141/reemplaz.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) 3 | print(arr) 4 | arr[arr%2 !=0] = -1 5 | print(arr) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/lunes_2182141/secuancias.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | a = np.array([1,2,3]) 3 | print(np.full((1,3),a[0])) 4 | print(np.concatenate(( np.full((1,3),a[0]) , np.full((1,3),a[1]) , np.full((1,3),a[2]) ,a,a,a,),axis=None)) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/lunes_2182141/silic_1.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | arr = np.arange(1,31) 3 | matriz = arr.reshape((6,5)) 4 | print(matriz) 5 | silicing1 = matriz[2:4 , :2 ] 6 | print(silicing1) 7 | 8 | silicing2 = matriz[ [0,4,5] , 3: ] 9 | print(silicing2) 10 | 11 | silicing3 = matriz[ [0,1,2,3] , [1,2,3,4] ] 12 | print(silicing3) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/lunes_2182141/silic_2.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from numpy.core.fromnumeric import reshape 3 | arr = np.arange(56) 4 | arr2 = np.array() 5 | for i in arr: 6 | if i 7 | 8 | 9 | print(matriz) -------------------------------------------------------------------------------- /Semana3/Reto/Entregas/reto3.py: -------------------------------------------------------------------------------- 1 | #Al igual que el reto 2, solo es ejecutar python reto3.py para que muestre todas las salidas a la vez. 2 | import numpy as np 3 | 4 | def extractOdds(): 5 | arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) 6 | arr = arr[arr % 2 == 1] 7 | print(arr) 8 | 9 | extractOdds() 10 | 11 | def convertToNegative(): 12 | arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) 13 | arr[arr % 2 == 1] = -1 14 | print(arr) 15 | 16 | convertToNegative() 17 | 18 | def convertMatrixVert(): 19 | a = np.arange(10).reshape(2,-1) 20 | b = np.repeat(1, 10).reshape(2,-1) 21 | 22 | c = np.vstack([a, b]) 23 | 24 | print(c) 25 | 26 | convertMatrixVert() 27 | 28 | def concatMatrix(): 29 | a = np.arange(10).reshape(2,-1) 30 | b = np.repeat(1, 10).reshape(2,-1) 31 | 32 | c = np.concatenate([a, b], axis=1) 33 | 34 | print(c) 35 | 36 | concatMatrix() 37 | 38 | def generateSecuenceNumpy(): 39 | arr = np.arange(10) 40 | print(arr) 41 | 42 | generateSecuenceNumpy() 43 | 44 | def getCommomValues(): 45 | a = np.array([1,2,3,2,3,4,3,4,5,6]) 46 | b = np.array([7,2,10,2,7,4,9,4,9,8]) 47 | c = a[np.in1d(a, b)] 48 | print(c) 49 | 50 | getCommomValues() 51 | 52 | def getIndexEqualValues(): 53 | a = np.array([1,2,3,2,3,4,3,4,5,6]) 54 | b = np.array([7,2,10,2,7,4,9,4,9,8]) 55 | 56 | c = np.where(a == b) 57 | 58 | print(c) 59 | 60 | getIndexEqualValues() 61 | 62 | def extracRangeValues(): 63 | 64 | a = np.array([2, 6, 1, 9, 10, 3, 27]) 65 | 66 | b = np.where(np.logical_and(a >= 5, a <= 10)) 67 | 68 | print(b) 69 | 70 | extracRangeValues() -------------------------------------------------------------------------------- /Semana3/Reto/array.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana3/Reto/array.png -------------------------------------------------------------------------------- /Semana3/Reto/array2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana3/Reto/array2.png -------------------------------------------------------------------------------- /Semana3/Reto/array3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana3/Reto/array3.png -------------------------------------------------------------------------------- /Semana3/armadura.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | from math import atan, cos, sin 3 | 4 | # kN 5 | carga_p = 10 6 | 7 | # longitudes en metros 8 | L = 2 9 | H = 2 10 | angulo_1 = atan(H / (3 * L / 2)) 11 | angulo_2 = atan(H / (L / 2)) 12 | A_y, B_y = carga_p, carga_p 13 | 14 | # ecuaciones de cada nodo están en el archivo ecuaciones.py 15 | 16 | # F12, F15, F25, F34, F35, F45, Ax, Bx 17 | ecuaciones = np.array( 18 | [ 19 | [1, cos(angulo_1), 0, 0, 0, 0, 1, 0], 20 | [0, sin(angulo_1), 0, 0, 0, 0, 0, 0], 21 | [-1, 0, cos(angulo_2), 0, 0, 0, 0, 0], 22 | [0, 0, sin(angulo_2), 0, 0, 0, 0, 0], 23 | [0, 0, 0, 1, -cos(angulo_2), 0, 0, 0], 24 | [0, 0, 0, 0, sin(angulo_2), 0, 0, 0], 25 | [0, 0, 0, 1, 0, cos(angulo_1), 0, -1], 26 | [0, 0, 0, 0, 0, sin(angulo_1), 0, 0], 27 | ] 28 | ) 29 | 30 | b = np.array([0, -carga_p, -carga_p, carga_p, -carga_p, carga_p, 0, -carga_p]) 31 | 32 | solucion = np.linalg.solve(ecuaciones, b) 33 | 34 | print(solucion) 35 | 36 | -------------------------------------------------------------------------------- /Semana3/bucle_for.py: -------------------------------------------------------------------------------- 1 | # import numpy as np 2 | # from math import cos, pi, sin, sqrt 3 | 4 | # np.set_printoptions(suppress=True) 5 | 6 | lista_numeros = [2, 4, 6, 1, 3] 7 | 8 | # for numero in lista_numeros: 9 | # print(numero ** 2) 10 | 11 | 12 | lista_numeros = range(11) 13 | # calcular el cuadrado de numeros pares entre 0 y 10 14 | 15 | for i in lista_numeros: 16 | if i % 2 == 0: 17 | print(i ** 2) 18 | 19 | # INPUT: No necesito (nombre del archivo) 20 | # 1. Leer el archivo 21 | archivo = open("mbox-short.txt") 22 | 23 | spam = [] 24 | 25 | for linea in archivo: 26 | if not linea.startswith("X-DSPAM-Confidence"): 27 | continue 28 | 29 | lista_string = linea.split() 30 | numero = float(lista_string[1]) 31 | spam.append(numero) 32 | 33 | promedio = sum(spam) / len(spam) 34 | print(promedio) 35 | 36 | # Lunes: 6-8pm, Viernes: 6-8pm, Jueves 6-8pm 37 | 38 | # 0 1 2 39 | # [3, 5, 6] 40 | archivo.close() 41 | 42 | # OUTPUT: Promedio de SPAM de mis correos 43 | 44 | # [1, 2, 3, 4, ...., 15] 45 | # CONTINUE: salta a la siguiente iteracion, todo lo que esta por debajo no se ejecuta 46 | for i in range(1, 16): 47 | if i % 2 != 0: 48 | if i == 9 or i == 11: 49 | continue 50 | print(i) 51 | 52 | # BREAK: Se sale completamente del bucle 53 | for i in range(1, 16): 54 | if i % 2 != 0: 55 | print(i) 56 | if i == 9: 57 | break 58 | -------------------------------------------------------------------------------- /Semana3/ecuaciones.py: -------------------------------------------------------------------------------- 1 | from math import atan, cos, sin 2 | 3 | import numpy as np 4 | 5 | np.set_printoptions(suppress=True) 6 | 7 | vector = np.array([1, 3, 4, 5]) 8 | print(vector) 9 | # 2X + 4Y = 10 10 | # -4X + 5Y = -4 11 | matriz = np.array( 12 | [ 13 | [2, 4], 14 | [-4, 5], 15 | ] 16 | ) 17 | vector = np.array([10, -4]) 18 | 19 | solucion = np.linalg.solve(matriz, vector) 20 | 21 | matriz_inversa = np.linalg.inv(matriz) 22 | solucion_2 = matriz_inversa.dot(vector) 23 | 24 | print(solucion) 25 | 26 | print(solucion_2) 27 | 28 | # carga en kN 29 | P = 10 30 | # longitud en metros 31 | L = 2 32 | H = 2 33 | 34 | # H SEA VARIABLE ENTRE 1 Y 5, PASO DE 1 35 | # Para cual H las fuerzas son minimas, maximas 36 | By, Ay = P, P 37 | 38 | angulo_1 = atan(H / (3 * L / 2)) 39 | angulo_2 = atan(H / (L / 2)) 40 | 41 | # [ 42 | # [H, F25, F34], 43 | # [H2, F25, F34], 44 | # ] 45 | 46 | # F12, F15, F25, F34, F35, F45, Ax, Bx 47 | 48 | matriz = np.array( 49 | [ 50 | [1, cos(angulo_1), 0, 0, 0, 0, 1, 0], 51 | [0, sin(angulo_1), 0, 0, 0, 0, 0, 0], 52 | [-1, 0, cos(angulo_2), 0, 0, 0, 0, 0], 53 | [0, 0, sin(angulo_2), 0, 0, 0, 0, 0], 54 | [0, 0, 0, 1, -cos(angulo_2), 0, 0, 0], 55 | [0, 0, 0, 0, sin(angulo_2), 0, 0, 0], 56 | [0, 0, 0, 1, 0, cos(angulo_1), 0, -1], 57 | [0, 0, 0, 0, 0, sin(angulo_1), 0, 0], 58 | ] 59 | ) 60 | 61 | vector = np.array([0, -P, -P, P, -P, P, 0, -P]) 62 | 63 | solucion = np.linalg.solve(matriz, vector) 64 | 65 | print(solucion) 66 | # NODO1 67 | # F15 * cos(angulo) + F12 + Ax = 0 68 | # F15 * sen(angulo) = -P 69 | 70 | # NODO2 71 | # F25 * cos(angulo) - F12 = -P 72 | # F25 * sen(angulo) = P 73 | 74 | # NODO3 75 | # F34 - F35 * cos(angulo) = -P 76 | # F35 * sen(angulo) = P 77 | 78 | # NODO4 79 | # F45 * cos(angulo) + F34 - Bx = 0 80 | # F45 * sen(angulo) = -P 81 | 82 | -------------------------------------------------------------------------------- /Semana3/horarios.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana3/horarios.xlsx -------------------------------------------------------------------------------- /Semana3/viernes.py: -------------------------------------------------------------------------------- 1 | # while 2 | # for 3 | # SINTAXIS: 4 | # 1. palabra clave for 5 | # 2. Definir el nombre de una variable (el nombre que sea) 6 | # 3. Escribo palabra clave in 7 | # 4. Escribo mi objeto iterable (COMO DECLARO LISTAS EN PYTHON) 8 | # 5. Escribo el codigo que voy a repetir indentado a la derecha 9 | # from math import pi 10 | 11 | # BASE 1 12 | # 2 13 | # [0, 1, 2 ... 10] 14 | for numero in range(11): 15 | if numero % 2 == 0: 16 | print(numero ** 2) 17 | # for i in range(numero): 18 | # print(i) 19 | 20 | # USAMOS pandas, jupyter y numpy 21 | # pip install nombre_libreria 22 | # pip install matplotlib 23 | # Pablo Moreno 24 | # 2200292 D2 25 | 26 | # Nicol Beleño 27 | # 2184025 - D2 28 | 29 | # milton vargas 30 | # 2192096 - D2 31 | 32 | # andres felipe rojas 33 | # 2190170-D2 34 | -------------------------------------------------------------------------------- /Semana4/Reto/Entregas/README.md: -------------------------------------------------------------------------------- 1 | # Carpeta de entregas de la Semana 4 2 | 3 | Acá es donde debe subir la carpeta con sus retos según lo indicado en el vídeo del [acá en el aula virtual](https://drive.google.com/file/d/1rY_XUXCMwqY3chPxq7QMhZSd6tIs5pBd/view?usp=sharing) 4 | -------------------------------------------------------------------------------- /Semana4/Reto/Guías/colors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana4/Reto/Guías/colors.png -------------------------------------------------------------------------------- /Semana4/Reto/Guías/lines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana4/Reto/Guías/lines.png -------------------------------------------------------------------------------- /Semana4/Reto/Guías/markers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana4/Reto/Guías/markers.png -------------------------------------------------------------------------------- /Semana4/Reto/Guías/salaries.csv: -------------------------------------------------------------------------------- 1 | Age,All_Devs,Python,JavaScript 2 | 18,17784,20046,16446 3 | 19,16500,17100,16791 4 | 20,18012,20000,18942 5 | 21,20628,24744,21780 6 | 22,25206,30500,25704 7 | 23,30252,37732,29000 8 | 24,34368,41247,34372 9 | 25,38496,45372,37810 10 | 26,42000,48876,43515 11 | 27,46752,53850,46823 12 | 28,49320,57287,49293 13 | 29,53200,45000,53437 14 | 30,56000,50000,56373 15 | 31,62316,55000,62375 16 | 32,64928,70000,66674 17 | 33,67317,71496,68745 18 | 34,68748,75370,68746 19 | 35,73752,83640,74583 20 | 36,77232,84666,79000 21 | 37,78000,84392,78508 22 | 38,78508,78254,79996 23 | 39,79536,85000,80403 24 | 40,82488,87038,83820 25 | 41,88935,91991,88833 26 | 42,90000,100000,91660 27 | 43,90056,94796,87892 28 | 44,95000,97962,96243 29 | 45,90000,93302,90000 30 | 46,91633,99240,99313 31 | 47,91660,102736,91660 32 | 48,98150,112285,102264 33 | 49,98964,100771,100000 34 | 50,100000,104708,100000 35 | 51,98988,108423,91660 36 | 52,100000,101407,99240 37 | 53,108923,112542,108000 38 | 54,105000,122870,105000 39 | 55,103117,120000,104000 40 | -------------------------------------------------------------------------------- /Semana4/Reto/README.md: -------------------------------------------------------------------------------- 1 | # Graph time! 2 | 3 | ## Análisis de fuerzas internas de una viga 4 | 5 | Desarrolle un software en Python, a través de la herramienta de Jupyter Notebook que analice el siguiente sistema estructural compuesto por una viga que se encuentra simplemente apoyada, es decir, el apoyo localizado en `A` es un de segundo grado y el localizado en `D` de primer grado. Determine: 6 | 7 | > Diagrama de fuerza cortante 8 | > Diagrama de momento flector 9 | > Fuerza cortante máxima 10 | > Momentos máximos (positivos y negativos si los hay) 11 | 12 | ![Viga de análisis](viga.png) 13 | 14 | ## Análisis de variaciones 15 | 16 | Suponga que se varían ambas cargas distribuidas desde su carga original hasta 50kN/m extra, con pasos de 10kN/m. 17 | 18 | > Es decir, la carga rectangular va desde 10kN/m hasta 60kN/m con pasos de 10 y lo mismo ocurre para la carga triangular 19 | 20 | Obtenga el momento máximo positivo para cada caso de carga y realice un gráfico en matplotlib donde se evidencie la variación del momento máximo con respecto aumenta la carga. 21 | 22 | > La gráfica debe tener en el `eje y` el valor del momento en kN-m y en el `eje x` el respectivo caso de carga para el cual se dio este fenómeno en kN/m (desde 10kN/m hasta 60kN/m) 23 | 24 | ### Opcional 25 | 26 | Por medio de subplots grafique los 6 diferentes diagramas de momento acorde con la variación de la carga 27 | -------------------------------------------------------------------------------- /Semana4/Reto/viga.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana4/Reto/viga.png -------------------------------------------------------------------------------- /Semana4/lunes.py: -------------------------------------------------------------------------------- 1 | # 1. INSTALAR MATPLOTLIB 2 | # pip install matplotlib 3 | 4 | # 2. INSTALAR JUPYTER 5 | # pip install jupyter 6 | 7 | # 3. Correr jupyter 8 | # jupyter notebook 9 | 10 | # pip install --upgrade pip 11 | 12 | 13 | # 1. IMPORTAR LIBRERIA 14 | import matplotlib.pyplot as plt 15 | -------------------------------------------------------------------------------- /Semana4/viga.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana4/viga.png -------------------------------------------------------------------------------- /Semana5/Reto/Entregas/README.md: -------------------------------------------------------------------------------- 1 | # Carpeta de entregas de la Semana 5 2 | 3 | Acá es donde debe subir la carpeta con sus retos según lo indicado en el vídeo del [acá en el aula virtual](https://drive.google.com/file/d/1rY_XUXCMwqY3chPxq7QMhZSd6tIs5pBd/view?usp=sharing) 4 | -------------------------------------------------------------------------------- /Semana5/Reto/Entregas/T2_2170255_Espejo_Maria.py: -------------------------------------------------------------------------------- 1 | codigo = (input("Por favor ingrese su codigo de estudiante: ")) 2 | x = 0 3 | for numero in codigo: 4 | sumar = int(numero) 5 | x+=sumar 6 | # ya tengo el valor de mi x 7 | 8 | import numpy as np 9 | import sympy as sp 10 | 11 | # DATOS 12 | y = x/3 13 | W_max = 0.005*x + 0.01*(y) 14 | p = 0.05*x 15 | l1 = 0.05*x 16 | l2 = 1.5*l1 17 | l3 = 0.5*l1 18 | angulo_p_Grados = 45 19 | angulo_p_Rad = (45 * np.pi)/180 20 | 21 | # PUNTUALIZACION DE CARGAS 22 | P1 = (l1*W_max)/2 23 | P2 = l2*W_max 24 | P3 = (l3*W_max)/2 25 | Px = p*(sp.cos(angulo_p_Rad)) 26 | Py = p*sp.sin(angulo_p_Rad) 27 | 28 | # ESTATICA 29 | # sumatoria de fuerzas en y 30 | Ay = P1 + P2 + P3 - Py 31 | # sumatoria de fuerzas en X 32 | Ax = -Px 33 | # sumatoria de momentos en C 34 | Ma = Ay*(l1+l2) - P1*(l2+(l1/3)) - P2*(l2/2) + P3*(l3/3) - Py*l3 35 | 36 | 37 | # FUERZAS INTERNAS 38 | 39 | # Tramo AB 0 < X <= l1 40 | from sympy.abc import X 41 | W_AB = (W_max*X)/l1 42 | V_AB = -(sp.integrate(W_AB,X)) + Ay 43 | M_AB = Ma + sp.integrate(V_AB,X) 44 | 45 | V_AB_Ev = V_AB.subs ({X: l1}) 46 | M_AB_Ev = M_AB.subs ({X: l1}) 47 | 48 | # Tramo BC 0 < X <= l2 49 | W_BC = W_max 50 | V_BC = -(sp.integrate(W_BC,X)) + V_AB_Ev 51 | M_BC = (sp.integrate(V_BC,X)) + M_AB_Ev 52 | 53 | V_BC_Ev = V_BC.subs ({X: l2}) 54 | M_BC_Ev = M_BC.subs ({X: l2}) 55 | 56 | # Tramo CD 0 < X <= l3 57 | W_CD = (-W_max*X)/l3 58 | V_CD = -(sp.integrate(W_CD,X)) + V_BC_Ev 59 | M_CD = (sp.integrate(V_CD,X)) + M_BC_Ev 60 | 61 | V_CD_Ev = V_CD.subs ({X: l3}) 62 | M_CD_Ev = M_CD.subs ({X: l3}) 63 | 64 | # Gráfica de cortante 65 | import matplotlib.pyplot as plt 66 | 67 | def tramo1(X): 68 | return(V_AB) 69 | def tramo2(X): 70 | return(V_BC) 71 | def tramo3(X): 72 | return(V_CD) 73 | a=0 74 | b=l1 75 | c=l2 76 | d=l3 77 | 78 | X=np.linspace(a,d,500) 79 | y = np.piecewise(X,[(a<=X) & (X $files = Get-Content -Path extensions.txt 11 | 12 | > ForEach ($file in $files) { code --install-extension $file } 13 | - Mac: 14 | > cat extensions.txt | xargs -L 1 code --install-extension 15 | -------------------------------------------------------------------------------- /Semana9/Taller/Primera_Entrega/T2_2170249_Apellido_Nombre/cortante.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana9/Taller/Primera_Entrega/T2_2170249_Apellido_Nombre/cortante.xlsx -------------------------------------------------------------------------------- /Semana9/Taller/Primera_Entrega/T2_2184025_Beleño_Nicole/T2_Ejercicio2.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "id": "af31df6b", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import numpy as nu\n", 11 | "import sympy as sy\n", 12 | "import pandas as pa" 13 | ] 14 | }, 15 | { 16 | "cell_type": "code", 17 | "execution_count": null, 18 | "id": "1428cdc2", 19 | "metadata": {}, 20 | "outputs": [], 21 | "source": [] 22 | } 23 | ], 24 | "metadata": { 25 | "kernelspec": { 26 | "display_name": "Python 3 (ipykernel)", 27 | "language": "python", 28 | "name": "python3" 29 | }, 30 | "language_info": { 31 | "codemirror_mode": { 32 | "name": "ipython", 33 | "version": 3 34 | }, 35 | "file_extension": ".py", 36 | "mimetype": "text/x-python", 37 | "name": "python", 38 | "nbconvert_exporter": "python", 39 | "pygments_lexer": "ipython3", 40 | "version": "3.10.1" 41 | } 42 | }, 43 | "nbformat": 4, 44 | "nbformat_minor": 5 45 | } 46 | -------------------------------------------------------------------------------- /Semana9/Taller/Primera_Entrega/T2_2201861_Oñate_Francisco/T2.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana9/Taller/Primera_Entrega/T2_2201861_Oñate_Francisco/T2.xlsx -------------------------------------------------------------------------------- /Semana9/Taller/README.md: -------------------------------------------------------------------------------- 1 | # Python-Coding-Lab 2 | 3 | This is the place where we will have our code for the course. You can download it and practice! 4 | 5 | ## Installing Visual Studio Code extensions 6 | 7 | Execute the corresponding commands in your command line in order to install VS Code extensions: 8 | 9 | - Windows: 10 | > $files = Get-Content -Path extensions.txt 11 | 12 | > ForEach ($file in $files) { code --install-extension $file } 13 | - Mac: 14 | > cat extensions.txt | xargs -L 1 code --install-extension 15 | -------------------------------------------------------------------------------- /Semana9/Taller/Segunda_Entrega/README.md: -------------------------------------------------------------------------------- 1 | # Python-Coding-Lab 2 | 3 | This is the place where we will have our code for the course. You can download it and practice! 4 | 5 | ## Installing Visual Studio Code extensions 6 | 7 | Execute the corresponding commands in your command line in order to install VS Code extensions: 8 | 9 | - Windows: 10 | > $files = Get-Content -Path extensions.txt 11 | 12 | > ForEach ($file in $files) { code --install-extension $file } 13 | - Mac: 14 | > cat extensions.txt | xargs -L 1 code --install-extension 15 | -------------------------------------------------------------------------------- /Semana9/Taller/Segunda_Entrega/T2_2170255_Espejo_Maria/ExcelTaller2.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana9/Taller/Segunda_Entrega/T2_2170255_Espejo_Maria/ExcelTaller2.xlsx -------------------------------------------------------------------------------- /Semana9/Taller/Segunda_Entrega/T2_2184002_Avendaño_JuanManuel/T2.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana9/Taller/Segunda_Entrega/T2_2184002_Avendaño_JuanManuel/T2.xlsx -------------------------------------------------------------------------------- /Semana9/Taller/Segunda_Entrega/T2_2184025_Beleño_Nicole/T2.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana9/Taller/Segunda_Entrega/T2_2184025_Beleño_Nicole/T2.xlsx -------------------------------------------------------------------------------- /Semana9/Taller/Segunda_Entrega/T2_2190184_CARVAJAL_CRISTIAN/T2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana9/Taller/Segunda_Entrega/T2_2190184_CARVAJAL_CRISTIAN/T2.pdf -------------------------------------------------------------------------------- /Semana9/Taller/Segunda_Entrega/T2_2190184_CARVAJAL_CRISTIAN/T2.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana9/Taller/Segunda_Entrega/T2_2190184_CARVAJAL_CRISTIAN/T2.xlsx -------------------------------------------------------------------------------- /Semana9/Taller/Segunda_Entrega/T2_2194518_Ortiz Jose/T2.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana9/Taller/Segunda_Entrega/T2_2194518_Ortiz Jose/T2.xlsx -------------------------------------------------------------------------------- /Semana9/Taller/Segunda_Entrega/T2_2195566_ÑIÑO_YUDI/T2.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana9/Taller/Segunda_Entrega/T2_2195566_ÑIÑO_YUDI/T2.xlsx -------------------------------------------------------------------------------- /Semana9/cortante.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana9/cortante.xlsx -------------------------------------------------------------------------------- /Semana9/cortante1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana9/cortante1.png -------------------------------------------------------------------------------- /Semana9/cortante2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edwardramirez31/Python-Coding-Lab/036f432b9381547dbbdf2288a3b150ce56676aeb/Semana9/cortante2.png -------------------------------------------------------------------------------- /extensions.txt: -------------------------------------------------------------------------------- 1 | aaron-bond.better-comments 2 | christian-kohler.path-intellisense 3 | CoenraadS.bracket-pair-colorizer 4 | cstrap.python-snippets 5 | dongli.python-preview 6 | idleberg.icon-fonts 7 | KevinRose.vsc-python-indent 8 | littlefoxteam.vscode-python-test-adapter 9 | mrmlnc.vscode-duplicate 10 | ms-python.python 11 | ms-python.vscode-pylance 12 | ms-toolsai.jupyter 13 | ms-toolsai.jupyter-keymap 14 | njpwerner.autodocstring 15 | oderwat.indent-rainbow 16 | Shan.code-settings-sync 17 | shardulm94.trailing-spaces 18 | steoates.autoimport 19 | VisualStudioExptTeam.vscodeintellicode 20 | vscode-icons-team.vscode-icons 21 | -------------------------------------------------------------------------------- /semana 9: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------------------------------------------------