This commit is contained in:
cmoreno 2026-08-20 19:03:34 -03:00
parent fa2f64c5e9
commit d0f39b6ab5
8 changed files with 66 additions and 13 deletions

12
clase_4/excep.py Normal file
View File

@ -0,0 +1,12 @@
try:
numero_1 = int(input("Ingrese un mumero "))
numero_2 = int(input("Ingrese otro numero "))
division= numero_1 / numero_2
except Exception as error:
print(f"Ocurrio un error: {type(error)}") #ValueError
else:
print(f"la division es { division}")
finally:
print("el proceso finalizó correctamente")

View File

@ -1,15 +1,7 @@
#import mi_modulo
import mi_modulo as mod import mi_modulo as mod
#from mi_modulo import tabla, saludame mod.tabla(5)
print(mod.saludame("Cristian"))
#from my_package import herramientas, pruebas
#pruebas.probando()
#herramientas.nombreCompleto("Nair", "Galarza")
mod.tabla(2)
print(mod.saludame("Pau"))
#mi_modulo.tabla(2)
#print(mi_modulo.saludame("Cristian"))
from my_package import herramientas, pruebas
pruebas.probando()
herramientas.nombreCompleto("Nair", "Galarza")

18
clase_5/excep.py Normal file
View File

@ -0,0 +1,18 @@
try:
numero_1 = int(input("ingrese un numero"))
numero_2= int(input("ingrese otro numero"))
division= numero_1 / numero_2
except ValueError:
print("ingrese un entero")
except ZeroDivisionError:
print("No se puede dividir por 0")
else:
print(f"la division es {division}")
finally:
print("el programa finalizó")
lista = [1,2,4]
print(lista[5])

14
clase_5/main.py Normal file
View File

@ -0,0 +1,14 @@
#import mi_modulo as mod
#mod.tabla(4)
#print(mod.saludo("Cristian"))
from mi_modulo import tabla
from new_paquete import operaciones, herramientas
tabla(5)
print(operaciones.suma(5,5))
print(herramientas.saludo())

11
clase_5/mi_modulo.py Normal file
View File

@ -0,0 +1,11 @@
def tabla (numero):
print(f"***********Tabla de multiplicar del {numero}")
for contador in range(1, 13):
operacion= numero * contador
print(f"{numero} x {contador} = {operacion}")
def saludo (nombre):
sal= f"hola {nombre} como estas"
return sal

View File

View File

@ -0,0 +1,3 @@
def saludo():
return f"soy un paquete"

View File

@ -0,0 +1,3 @@
def suma (numero1 , numero2):
return numero1 + numero2