From bc058e682215e653c587a449da3d4e6966ed8012 Mon Sep 17 00:00:00 2001 From: "Juan M. Ley" Date: Mon, 9 Feb 2026 19:01:56 -0600 Subject: [PATCH] day 9 --- day8/excersise.py | 6 +++ day9/excersises.py | 123 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 day8/excersise.py create mode 100644 day9/excersises.py diff --git a/day8/excersise.py b/day8/excersise.py new file mode 100644 index 0000000..071079d --- /dev/null +++ b/day8/excersise.py @@ -0,0 +1,6 @@ +dog = {} + +dog['color'] = 'white' +dog['breed'] = +dog['legs'] = +dog['age'] = \ No newline at end of file diff --git a/day9/excersises.py b/day9/excersises.py new file mode 100644 index 0000000..d17e08d --- /dev/null +++ b/day9/excersises.py @@ -0,0 +1,123 @@ +# LVL 1 + +#EX1 + +edad = int(input("Escribe tu edad: ")) + +if (edad < 18): + print(f"Te faltan {18 - edad} años para poder tomar") +else: + print(f"Ándele mi rey, puede tomar") + + +# EX2 + +mi_edad = int(input("Escribe mi edad: ")) +tu_edad = int(input("Escribe tu edad: ")) + +if (mi_edad > tu_edad): + print("Soy mayor que tú por", tu_edad-mi_edad, "años") +elif (tu_edad > mi_edad): + print("Eres mayor que yo por", tu_edad-mi_edad, "años") +else: + print("Tenemos la misma edad") + +# EX3 +a = int(input("Escribe el valor de a: ")) +b = int(input("Escribe el valor de b: ")) + +if (a>b): + print(f"{a} es mayor que {b}") +elif (a= 60 and calif < 70): + print("D") +elif (calif >= 70 and calif < 80): + print("C") +elif (calif >= 80 and calif < 90): + print("B") +elif (calif >= 90 and calif <= 100): + print("A") + +# EX2 + +prim = ["marzo", "abril", "mayo"] +vera = ["junio", "julio", "agosto"] +oton = ["septiembre", "octubre", "noviembre"] +invi = ["diciembre", "enero", "febrero"] + +mes = input("Escribe un mes (en minúsculas): ") + +if (mes in prim): + print("Estás en primavera.") +elif (mes in vera): + print("Estás en verano.") +elif (mes in oton): + print("Estás en otoño.") +elif (mes in invi): + print("Estás en invierno.") +else: + print("no pusiste un mes válido") + + +# EX3 + +fruits = ['platano', 'naranja', 'mango', 'limon'] + +fruta = input("Escribe el nombre de una fruta: ") + +if (fruta in fruits): + print("ya está en la lista") +else: + print("fruta no encontrada, añadiendo") + fruits.append(fruta) + print(fruits) + + +# LVL 3 + +# EX + +person={ + 'first_name': 'Asabeneh', + 'last_name': 'Yetayeh', + 'age': 250, + 'country': 'Finland', + 'is_married': True, + 'skills': ['JavaScript', 'React', 'Node', 'MongoDB', 'Python'], + 'address': { + 'street': 'Space street', + 'zipcode': '02210' + } + } + + +# - + +if ('skills' in person): + print(person['skills']) + if ('Python' in person['skills']): + print(person['skills'][4]) + elif ('JavaScript' in person['skills'] and 'React' in person['skills']): + print("Es Front") + elif ('Python' in person['skills'] and 'Node' in person['skills'] and 'MongoDB' in person['skills']): + print("Es Back") + elif ('JavaScript' in person['skills'] and 'React' in person['skills'] and 'Python' in person['skills'] and 'Node' in person['skills'] and 'MongoDB' in person['skills']): + print("Es Full") + else: + print("Sepa la bola qué sea") + +if (person['is_married'] and person['country'] == 'Finland'): + print(f"{person['first_name']} {person['last_name']} vive en {person['country']} y está felizmente casado")