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
10 changes: 5 additions & 5 deletions exercises/exercise1.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
lado_cuadrado = 5

# COMPLETAR - INICIO

area_cuadrado = lado_cuadrado * lado_cuadrado
# COMPLETAR - FIN

assert area_cuadrado == 25
Expand All @@ -22,7 +22,7 @@
lado_cuadrado = 5

# COMPLETAR - INICIO

area_cuadrado = lado_cuadrado ** 2
# COMPLETAR - FIN

assert area_cuadrado == 25
Expand All @@ -35,7 +35,7 @@
lado_cuadrado = 5

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

cantidad_a_comprar = presupuesto_disponible // precio
# COMPLETAR - FIN

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

# COMPLETAR - INICIO

es_divisible_por_siete = numero_incalculable % 7 == 0
# COMPLETAR - FIN

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

# COMPLETAR - INICIO

variable_01=bool(A)
# COMPLETAR - FIN

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

# COMPLETAR - INICIO

variable_02=bool(Domicilio)
# COMPLETAR - FIN

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

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

# COMPLETAR - FIN

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

# COMPLETAR - INICIO

variable_04=bool(lista_de_compras)
print(variable_04)
# COMPLETAR - FIN

assert variable_04 is True
Expand All @@ -60,7 +63,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 +76,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 @@ -6,11 +6,14 @@
True si al menos una de las variables es True.
"""

from ast import Not


esta_lloviendo = True
riego_activado = True

# COMPLETAR - INICIO

piso_mojado = riego_activado or esta_lloviendo
# COMPLETAR - FIN

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

# COMPLETAR - INICIO

area_mayor_a_cinco = area_cuadrado > 5 and not lado_cuadrado < 3
# COMPLETAR - FIN

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

# COMPLETAR - INICIO

resultado = numero_1 True or False numero_2
# COMPLETAR - FIN

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

# COMPLETAR - INICIO

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

assert resultado == 80
9 changes: 6 additions & 3 deletions exercises/exercise3.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
edad_02 = 41

# COMPLETAR - INICIO
comparar_nombre_y_edad = persona_01 = persona_02 and edad_01 != edad_02

# COMPLETAR - FIN

Expand All @@ -28,7 +29,8 @@
modelo_de_auto = 1998

# COMPLETAR - INICIO

comparar_marca_y_modelo = not marca_del_auto == "Ford" and modelo_de_auto < 2000
print (comparar_marca_y_modelo)
# COMPLETAR - FIN

assert comparar_marca_y_modelo
Expand All @@ -46,7 +48,8 @@
superficie_de_campo_03 = 8512

# 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 +69,7 @@
peras = 30

# COMPLETAR - INICIO

comparar_frutas = bananas < naranjas/2 < manzanas*2 <= peras**2
# COMPLETAR - FIN

assert comparar_frutas
9 changes: 5 additions & 4 deletions exercises/exercise4.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
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 +27,7 @@
numero_03 = 789

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

strings_concatenados = variable_01 + variable_02 + variable_03
# COMPLETAR - FIN

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

# COMPLETAR - INICIO

strings_concatenados = "¡Mamá ""estoy concatenando ""strings!"
# COMPLETAR - FIN

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

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

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

assert (
strings_concatenados == "Le debo 6 pesos a un amigo hace 6 años. Se llama Ezequiel"
)


"""
Formatear las siguientes variables en un único string.
Restricción: Utilizar f-Strings.
Expand All @@ -83,7 +83,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