diff --git a/exercises/exercise1.py b/exercises/exercise1.py index 07cc71d..a1a842e 100644 --- a/exercises/exercise1.py +++ b/exercises/exercise1.py @@ -9,7 +9,7 @@ lado_cuadrado = 5 # COMPLETAR - INICIO - +area_cuadrado= lado_cuadrado*lado_cuadrado # COMPLETAR - FIN assert area_cuadrado == 25 @@ -22,7 +22,7 @@ lado_cuadrado = 5 # COMPLETAR - INICIO - +area_cuadrado= lado_cuadrado**2 # COMPLETAR - FIN assert area_cuadrado == 25 @@ -35,7 +35,7 @@ lado_cuadrado = 5 # COMPLETAR - INICIO - +area_cuadrado= pow(lado_cuadrado,2) # COMPLETAR - FIN assert area_cuadrado == 25 @@ -50,7 +50,7 @@ presupuesto_disponible = 10 # COMPLETAR - INICIO - +cantidad_a_comprar = presupuesto_disponible// precio # COMPLETAR - FIN assert cantidad_a_comprar == 2 @@ -64,7 +64,7 @@ numero_incalculable = 2 ** 54 - 1 # COMPLETAR - INICIO - +es_divisible_por_siete = numero_incalculable % 7 # COMPLETAR - FIN -assert es_divisible_por_siete \ No newline at end of file +assert es_divisible_por_siete==0 \ No newline at end of file diff --git a/exercises/exercise10.py b/exercises/exercise10.py index 56d9848..556b1ea 100644 --- a/exercises/exercise10.py +++ b/exercises/exercise10.py @@ -8,7 +8,7 @@ A = 5 # COMPLETAR - INICIO - +variable_01=A==5 # COMPLETAR - FIN assert variable_01 is True @@ -21,7 +21,7 @@ Domicilio = "" # COMPLETAR - INICIO - +variable_02= Domicilio!="" # COMPLETAR - FIN assert variable_02 is False @@ -34,7 +34,7 @@ Domicilio = "Alsina 2446" or "Pueyrredón y la vía" # COMPLETAR - INICIO - +variable_03= Domicilio=="Alsina 2446" or "Pueyrredón y la vía" # COMPLETAR - FIN assert variable_03 is True @@ -47,7 +47,8 @@ lista_de_compras = "No comprar nada" and ["Pan", "Aceite", "Sal"] # COMPLETAR - INICIO - +variable_04= lista_de_compras== ("No comprar nada" and ["Pan", "Aceite", "Sal"]) +print(variable_04) # COMPLETAR - FIN assert variable_04 is True @@ -60,7 +61,7 @@ lista_de_ids = 0 and [1236, 5565, 8956, 2534] # COMPLETAR - INICIO - +variable_05=lista_de_ids != (0 and [1236, 5565, 8956, 2534]) # COMPLETAR - FIN assert variable_05 is False @@ -73,7 +74,7 @@ diccionario = {} and {"Nombre": "Alberto Paz", "DNI": 12365855} # COMPLETAR - INICIO - +variable_06= diccionario!=({} and {"Nombre": "Alberto Paz", "DNI": 12365855} ) # COMPLETAR - FIN assert variable_06 is False \ No newline at end of file diff --git a/exercises/exercise2.py b/exercises/exercise2.py index 7f099e9..f96a614 100644 --- a/exercises/exercise2.py +++ b/exercises/exercise2.py @@ -6,11 +6,15 @@ True si al menos una de las variables es True. """ +from ast import Not + + esta_lloviendo = True riego_activado = True # COMPLETAR - INICIO - +piso_mojado = esta_lloviendo or riego_activado + # COMPLETAR - FIN assert piso_mojado @@ -26,7 +30,8 @@ area_cuadrado = pow(lado_cuadrado, 2) # COMPLETAR - INICIO - +area_mayor_a_cinco = not area_cuadrado > lado_cuadrado + # COMPLETAR - FIN assert area_mayor_a_cinco @@ -41,7 +46,7 @@ numero_2 = 50 # COMPLETAR - INICIO - +resultado = numero_1 % 7==0 and not numero_2 % 7 ==0 # COMPLETAR - FIN assert resultado @@ -60,7 +65,8 @@ variable_05 = 100 # COMPLETAR - INICIO - +resultado= variable_03 or variable_02 or variable_01 or variable_04 or variable_04 +print(resultado) # COMPLETAR - FIN assert resultado == 80 \ No newline at end of file diff --git a/exercises/exercise3.py b/exercises/exercise3.py index ceb4bd6..5457a78 100644 --- a/exercises/exercise3.py +++ b/exercises/exercise3.py @@ -12,7 +12,7 @@ edad_02 = 41 # COMPLETAR - INICIO - +comparar_nombre_y_edad= persona_01==persona_02 and edad_01!=edad_02 # COMPLETAR - FIN assert comparar_nombre_y_edad @@ -28,7 +28,7 @@ modelo_de_auto = 1998 # COMPLETAR - INICIO - +comparar_marca_y_modelo= not marca_del_auto=="Ford" and modelo_de_auto<2000 # COMPLETAR - FIN assert comparar_marca_y_modelo @@ -46,7 +46,7 @@ superficie_de_campo_03 = 8512 # COMPLETAR - INICIO - +comparar_superficie= superficie_de_campo_01superficie_de_campo_03 # COMPLETAR - FIN assert comparar_superficie @@ -66,7 +66,7 @@ peras = 30 # COMPLETAR - INICIO - +comparar_frutas= bananas