Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions exercises/a.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a
15 changes: 10 additions & 5 deletions exercises/exercise1.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
lado_cuadrado = 5

# COMPLETAR - INICIO

area_cuadrado = lado_cuadrado * lado_cuadrado
print(area_cuadrado)
# COMPLETAR - FIN

assert area_cuadrado == 25
Expand All @@ -22,9 +23,10 @@
lado_cuadrado = 5

# COMPLETAR - INICIO
area_cuadrado = lado_cuadrado ** 2

# COMPLETAR - FIN

print(area_cuadrado)
assert area_cuadrado == 25


Expand All @@ -35,7 +37,8 @@
lado_cuadrado = 5

# COMPLETAR - INICIO

area_cuadrado = pow(lado_cuadrado, 2)
print(area_cuadrado)
# COMPLETAR - FIN

assert area_cuadrado == 25
Expand All @@ -50,7 +53,8 @@
presupuesto_disponible = 10

# COMPLETAR - INICIO

cantidad_a_comprar = presupuesto_disponible // precio
print(cantidad_a_comprar)
# COMPLETAR - FIN

assert cantidad_a_comprar == 2
Expand All @@ -64,7 +68,8 @@
numero_incalculable = 2 ** 54 - 1

# COMPLETAR - INICIO

es_divisible_por_siete = numero_incalculable % 7 == 0
print(es_divisible_por_siete)
# COMPLETAR - FIN

assert es_divisible_por_siete
14 changes: 8 additions & 6 deletions exercises/exercise10.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
A = 5

# COMPLETAR - INICIO

variable_01 = bool(A)
print(variable_01)
# COMPLETAR - FIN

assert variable_01 is True
Expand All @@ -21,7 +22,7 @@
Domicilio = ""

# COMPLETAR - INICIO

variable_02 = bool(Domicilio)
# COMPLETAR - FIN

assert variable_02 is False
Expand All @@ -34,7 +35,8 @@
Domicilio = "Alsina 2446" or "Pueyrredón y la vía"

# COMPLETAR - INICIO

variable_03 = bool(Domicilio)
print(variable_03)
# COMPLETAR - FIN

assert variable_03 is True
Expand All @@ -47,7 +49,7 @@
lista_de_compras = "No comprar nada" and ["Pan", "Aceite", "Sal"]

# COMPLETAR - INICIO

variable_04 = bool(lista_de_compras)
# COMPLETAR - FIN

assert variable_04 is True
Expand All @@ -60,7 +62,7 @@
lista_de_ids = 0 and [1236, 5565, 8956, 2534]

# COMPLETAR - INICIO

variable_05 = bool(lista_de_ids)
# COMPLETAR - FIN

assert variable_05 is False
Expand All @@ -73,7 +75,7 @@
diccionario = {} and {"Nombre": "Alberto Paz", "DNI": 12365855}

# COMPLETAR - INICIO

variable_06 = bool(diccionario)
# COMPLETAR - FIN

assert variable_06 is False
12 changes: 8 additions & 4 deletions exercises/exercise2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
riego_activado = True

# COMPLETAR - INICIO

piso_mojado = (esta_lloviendo or riego_activado)
print(piso_mojado)
# COMPLETAR - FIN

assert piso_mojado
Expand All @@ -26,7 +27,8 @@
area_cuadrado = pow(lado_cuadrado, 2)

# COMPLETAR - INICIO

area_mayor_a_cinco = area_cuadrado + (lado_cuadrado * lado_cuadrado)
print(area_mayor_a_cinco)
# COMPLETAR - FIN

assert area_mayor_a_cinco
Expand All @@ -41,7 +43,8 @@
numero_2 = 50

# COMPLETAR - INICIO

resultado = (numero_1 / 7) or (numero_2 / 7)
print(resultado)
# COMPLETAR - FIN

assert resultado
Expand All @@ -60,7 +63,8 @@
variable_05 = 100

# COMPLETAR - INICIO

resultado = (variable_01 or variable_02) and variable_03 or (variable_04 and variable_05)
print(resultado)
# COMPLETAR - FIN

assert resultado == 80
12 changes: 11 additions & 1 deletion exercises/exercise3.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@

# COMPLETAR - INICIO

comparar_nombre_y_edad = (persona_01 and persona_02) and (edad_01 != edad_02)

print(comparar_nombre_y_edad)
# COMPLETAR - FIN

assert comparar_nombre_y_edad



"""
Construir una expresión lógica que use TODAS las variables y cuyo resultado sea
True si un auto no es de marca Ford y su modelo es igual o anterior al año 2000.
Expand All @@ -28,7 +32,9 @@
modelo_de_auto = 1998

# COMPLETAR - INICIO
comparar_marca_y_modelo = (marca_del_auto or "Ford") and (modelo_de_auto < 2000)

print(comparar_marca_y_modelo)
# COMPLETAR - FIN

assert comparar_marca_y_modelo
Expand All @@ -47,6 +53,9 @@

# COMPLETAR - INICIO

comparar_superficie = (superficie_de_campo_01 < superficie_de_campo_02 > superficie_de_campo_03)

print(comparar_superficie)
# COMPLETAR - FIN

assert comparar_superficie
Expand All @@ -66,7 +75,8 @@
peras = 30

# COMPLETAR - INICIO

comparar_frutas = (bananas < naranjas /2 ) and (naranjas /2 < manzanas **2) and (manzanas*2 <= peras**2)
print(comparar_frutas)
# COMPLETAR - FIN

assert comparar_frutas
14 changes: 10 additions & 4 deletions exercises/exercise4.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
Convertir los numeros de string a enteros y luego sumarlos.
"""



numero_01 = "123"
numero_02 = "456"
numero_03 = "789"
numero_04 = "132"

# COMPLETAR - INICIO

suma_de_numeros = int(numero_01) + int(numero_02) + int(numero_03) + int(numero_04)
print(suma_de_numeros)
# COMPLETAR - FIN

assert suma_de_numeros == 1500
Expand All @@ -26,7 +29,8 @@
numero_03 = 789

# COMPLETAR - INICIO

suma_de_numeros_string = str(numero_01) + str(numero_02) + str(numero_03)
print(suma_de_numeros_string)
# COMPLETAR - FIN

assert suma_de_numeros_string == "123456789"
Expand All @@ -42,7 +46,8 @@
numero_hexadecimal = "0x6f540"

# COMPLETAR - INICIO

multiplicacion_de_numeros = int(numero_binario,2) * int(numero_octal,8) * int(numero_hexadecimal,16)
print(multiplicacion_de_numeros)
# COMPLETAR - FIN

assert multiplicacion_de_numeros == 44397345600000000
Expand All @@ -59,7 +64,8 @@
numero_04 = 654

# COMPLETAR - INICIO

resultado_resta = int(numero_01) - int(numero_02,16) - int(numero_03,16) - int(numero_04)
print(resultado_resta)
# COMPLETAR - FIN

assert resultado_resta == -456350
15 changes: 10 additions & 5 deletions exercises/exercise5.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
variable_03 = "a todos!"

# COMPLETAR - INICIO

strings_concatenados = (variable_01 + variable_02 + variable_03)
print(strings_concatenados)
# COMPLETAR - FIN

assert strings_concatenados == "¡Buenos días a todos!"
Expand All @@ -28,7 +29,8 @@
# "strings!"

# COMPLETAR - INICIO

strings_concatenados = "!Mama estoy concatenando strings!"
print(strings_concatenados)
# COMPLETAR - FIN

assert strings_concatenados == "¡Mamá estoy concatenando strings!"
Expand All @@ -45,7 +47,8 @@
variable_03 = " pesos a un amigo."

# COMPLETAR - INICIO

strings_concatenados = variable_01 + str(variable_02) + variable_03
print(strings_concatenados)
# COMPLETAR - FIN

assert strings_concatenados == "Le debo 600 pesos a un amigo."
Expand All @@ -64,7 +67,8 @@
variable_05 = "Ezequiel"

# COMPLETAR - INICIO

strings_concatenados = "{}${}{}{}{}. Se llama {}".format(variable_01,variable_02,variable_03, variable_02, variable_04, variable_05)
print(strings_concatenados)
# COMPLETAR - FIN

assert (
Expand All @@ -83,7 +87,8 @@
variable_04 = 4

# COMPLETAR - INICIO

strings_concatenados = (f"{variable_01}{variable_02}{variable_03}{variable_04}")
print(strings_concatenados)
# COMPLETAR - FIN

assert strings_concatenados == "Le pagué 2 pesos que le debía a Ezequiel, me faltan $4"
Loading