From 5b501c4acf152e3e1568c5ae3321ed0425d48d25 Mon Sep 17 00:00:00 2001 From: JuanitoSnoopy Date: Fri, 3 Oct 2025 16:02:48 -0500 Subject: [PATCH 1/5] Add files via upload --- 2001_juan-guiza_v1.py | 137 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 2001_juan-guiza_v1.py diff --git a/2001_juan-guiza_v1.py b/2001_juan-guiza_v1.py new file mode 100644 index 0000000..3ec9e0d --- /dev/null +++ b/2001_juan-guiza_v1.py @@ -0,0 +1,137 @@ +class Contact: + def __init__(self,nombre,apellido,email,telefono): + self.nombre=nombre + self.apellido=apellido + self.email=email + self.telefono=telefono + + +class ContactBook: + def __init__(self): + self.contactos=list() + self.numero_de_contactos=0 + def add(self,datos): + nuevo_contacto= Contact(datos[0],datos[1],datos[2],datos[3]) + posicion=0 + for i in range(0,self.numero_de_contactos,1): + if(self.contactos[i].apellido {self.contactos[i].telefono}") + return + + +def main(): + Directorio = ContactBook() + datos=int(input("Ingresa el numero de operaciones a realizar: ")) + cuenta=0 + while (cuenta 328732 + Sanchez,Jhon 237423 + + Usuario eliminado con exito + + Sanchez,Jhon 237423 + + TESTCASE#2 + + Entradas: + + 6 + ADD Juan Florez aaa@gmail.com 328732 + ADD Valentina Giraldo hshs@gmail.com 739823 + LIST + ADD Andres Fernandez jdhsu@gmail.com 32424 + LIST + FIND Andres + + Salidas: + Florez,Juan 328732 + Giraldo,Valentina 739823 + + Fernandez,Andres 32424 + Florez,Juan 328732 + Giraldo,Valentina 739823 + + El usuario identificado por Andres se encuentra en el contact_book + + TESTCASE#3: + + Entradas: + 7 + ADD Juan Florez aaa@gmail.com 328732 + ADD Valentina Giraldo hshs@gmail.com 739823 + ADD Andres Fernandez jdhsu@gmail.com 32424 + FIND jdhsu@gmail.com + FIND Horacio + DEL hshs@gmail.com + LIST + + Salidas: + + El usuario identificado por jdhsu@gmail.com se encuentra en el contact_book + + El usuario identificado por Horacio NO se encuentra en el contact_book + + Usuario eliminado con Exito + + Fernandez,Andres 32424 + Florez,Juan 328732 + +""" \ No newline at end of file From b934c822d0208f6b2eb25590b4abc044f384a8ab Mon Sep 17 00:00:00 2001 From: JuanitoSnoopy Date: Fri, 3 Oct 2025 16:30:27 -0500 Subject: [PATCH 2/5] Add files via upload --- 2002_juan-guiza_v1.py | 110 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 2002_juan-guiza_v1.py diff --git a/2002_juan-guiza_v1.py b/2002_juan-guiza_v1.py new file mode 100644 index 0000000..05b0e7d --- /dev/null +++ b/2002_juan-guiza_v1.py @@ -0,0 +1,110 @@ +class Course: + def __init__(self,nombre,creditos,nota): + self.nombre=nombre + self.creditos=creditos + self.nota=nota + +class Semester: + def __init__(self): + self.cursos=list() + self.No_cursos=0 + self.suma_total=0 + def add(self,datos): + nuevo_curso= Course(datos[0],int(datos[1]),float(datos[2])) + for i in range(0,self.No_cursos,1): + if(nuevo_curso.nombre.lower()==self.cursos[i].nombre.lower()): + print("ERROR:DUP") + return + self.suma_total+=nuevo_curso.nota + self.cursos.append(nuevo_curso) + self.No_cursos+=1 + return + def avg(self): + promedio = self.suma_total/self.No_cursos + promedio=round(promedio,2) + return promedio + def list(self): + for i in range(0,self.No_cursos,1): + print(f"Creditos: {self.cursos[i].creditos}, Nombre: {self.cursos[i].nombre}") + return + +def main(): + Semestre = Semester() + datos=int(input("Ingresa el numero de operaciones a realizar: ")) + cuenta=0 + while (cuenta Date: Fri, 3 Oct 2025 16:55:07 -0500 Subject: [PATCH 3/5] Add files via upload --- 2003_juan-guiza_v1.py | 99 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 2003_juan-guiza_v1.py diff --git a/2003_juan-guiza_v1.py b/2003_juan-guiza_v1.py new file mode 100644 index 0000000..47cbbdd --- /dev/null +++ b/2003_juan-guiza_v1.py @@ -0,0 +1,99 @@ +class Node(): + def __init__(self,valor): + self.valor=valor + self.siguiente=None + +class Stack(): + def __init__(self): + self.top= None + self.tamano=0 + def push(self,nodo): + if(self.tamano==0): + self.top=nodo + self.tamano+=1 + else: + nodo.siguiente=self.top + self.top= nodo + self.tamano+=1 + return + def pop(self): + if(self.tamano==0): + print("ERROR:EMPTY") + else: + self.top=self.top.siguiente + self.tamano-=1 + return + def peek(self): + return self.top.valor + def size(self): + return self.tamano + + +def main(): + Pila=Stack() + datos=int(input("Ingresa el numero de operaciones a realizar: ")) + cuenta=0 + while (cuenta Date: Fri, 3 Oct 2025 16:58:21 -0500 Subject: [PATCH 4/5] Update 2003_juan-guiza_v1.py --- 2003_juan-guiza_v1.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/2003_juan-guiza_v1.py b/2003_juan-guiza_v1.py index 47cbbdd..79dae73 100644 --- a/2003_juan-guiza_v1.py +++ b/2003_juan-guiza_v1.py @@ -24,7 +24,10 @@ def pop(self): self.tamano-=1 return def peek(self): - return self.top.valor + if(self.tamano==0): + print("ERROR:EMPTY") + else: + return self.top.valor def size(self): return self.tamano @@ -97,3 +100,4 @@ def main(): Analisis de Complejidad: Todas las operaciones son O(1) ya que ninguna depende de la cantidad de datos entrantes, todas las operaciones se hacen en tiempo constante """ + From d765044a80ffe4e2235e66cd6fe5c5dc282b2083 Mon Sep 17 00:00:00 2001 From: JuanitoSnoopy Date: Fri, 3 Oct 2025 17:05:40 -0500 Subject: [PATCH 5/5] Update 2003_juan-guiza_v1.py --- 2003_juan-guiza_v1.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/2003_juan-guiza_v1.py b/2003_juan-guiza_v1.py index 79dae73..2a96903 100644 --- a/2003_juan-guiza_v1.py +++ b/2003_juan-guiza_v1.py @@ -20,16 +20,20 @@ def pop(self): if(self.tamano==0): print("ERROR:EMPTY") else: + print(f"El valor {self.top.valor} fue eliminado") self.top=self.top.siguiente self.tamano-=1 + return def peek(self): if(self.tamano==0): print("ERROR:EMPTY") + return else: - return self.top.valor + print(self.top.valor) + return def size(self): - return self.tamano + print(self.tamano) def main(): @@ -46,9 +50,9 @@ def main(): elif(entrada[0]=="POP"): Pila.pop() elif(entrada[0]=="PEEK"): - print( Pila.peek()) + Pila.peek() elif(entrada[0]=="SIZE"): - print(Pila.size()) + Pila.size() cuenta+=1 main() @@ -66,6 +70,8 @@ def main(): SIZE Salidas: + El valor 377.34 fue eliminado + El valor 45 fue eliminado Pera 1 @@ -73,7 +79,7 @@ def main(): Entradas: 7 POP - POP + PEEK PUSH Banano SIZE PUSH Rabano @@ -95,9 +101,11 @@ def main(): PEEK Salidas: + El valor 323 fue eliminado 63673.3 Analisis de Complejidad: Todas las operaciones son O(1) ya que ninguna depende de la cantidad de datos entrantes, todas las operaciones se hacen en tiempo constante """ +