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
9 changes: 5 additions & 4 deletions exercises/exercise1.py → 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 = pow(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,6 +64,7 @@
numero_incalculable = 2 ** 54 - 1

# COMPLETAR - INICIO
es_divisible_por_siete = not(numero_incalculable % 7)

# COMPLETAR - FIN

Expand Down
15 changes: 9 additions & 6 deletions exercises/exercise10.py → exercise10.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
Interpretar como booleano la siguente variable y guardar el valor resultante en variable_01
"""

from xmlrpc.client import boolean


A = 5

# COMPLETAR - INICIO

variable_01 = bool(A)
# COMPLETAR - FIN

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

# COMPLETAR - INICIO

variable_02 = bool(Domicilio)
# COMPLETAR - FIN

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

# COMPLETAR - INICIO

variable_03 = bool(Domicilio)
# COMPLETAR - FIN

assert variable_03 is True
Expand All @@ -47,7 +50,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 +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
21 changes: 9 additions & 12 deletions exercises/exercise2.py → exercise2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"""Lógica Simple y Cortocircuito"""


"""
Construir una expresión lógica que use TODAS las variables y cuyo resultado sea
Expand All @@ -10,12 +8,13 @@
riego_activado = True

# COMPLETAR - INICIO

piso_mojado = esta_lloviendo or riego_activado
# COMPLETAR - FIN

assert piso_mojado



"""
Construir una expresión lógica que use TODAS las variables y cuyo resultado sea
True si el área es mayor a 5.
Expand All @@ -26,27 +25,25 @@
area_cuadrado = pow(lado_cuadrado, 2)

# COMPLETAR - INICIO

area_mayor_a_cinco = not ( area_cuadrado <= lado_cuadrado )
# COMPLETAR - FIN

assert area_mayor_a_cinco

assert area_mayor_a_cinco

"""
Construir una expresión lógica que use TODAS las variables y cuyo resultado sea
"""Construir una expresión lógica que use TODAS las variables y cuyo resultado sea
True si el número 1 es divisible por 7 y al mismo tiempo el número 2 no lo es.
"""

numero_1 = 49
numero_2 = 50

# COMPLETAR - INICIO
resultado = numero_1%7==0 and numero_2 %7!=0


# COMPLETAR - FIN

assert resultado


"""
Construir una expresión lógica que use TODAS las variables y cuyo resultado sea
el mismo valor de la variable 3.
Expand All @@ -57,10 +54,10 @@
variable_02 = True
variable_03 = 80
variable_04 = "90"
variable_05 = 100
variable_05 = 100

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

comparar_nombre_y_edad=(persona_01 and persona_02) and ( edad_01 and edad_02)
# COMPLETAR - FIN

assert comparar_nombre_y_edad
Expand All @@ -28,6 +28,7 @@
modelo_de_auto = 1998

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

# COMPLETAR - FIN

Expand All @@ -46,7 +47,7 @@
superficie_de_campo_03 = 8512

# COMPLETAR - INICIO

comparar_superficie = (superficie_de_campo_01<superficie_de_campo_02)and(superficie_de_campo_02>superficie_de_campo_03)
# COMPLETAR - FIN

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

# COMPLETAR - INICIO

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

assert comparar_frutas
9 changes: 5 additions & 4 deletions exercises/exercise4.py → exercise4.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
numero_04 = "132"

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

multiplicacion_de_numeros=int(numero_binario)+ int(numero_octal)+int(numero_hexadecimal)
# COMPLETAR - FIN

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

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

# COMPLETAR - FIN

assert resultado_resta == -456350
assert resultado_resta == -456350
12 changes: 9 additions & 3 deletions exercises/exercise5.py → exercise5.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
Restricción: Utilizar el operador +.
"""

from tabnanny import check


variable_01 = "¡Buenos "
variable_02 = "días "
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 +31,7 @@
# "strings!"

# COMPLETAR - INICIO

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

assert strings_concatenados == "¡Mamá estoy concatenando strings!"
Expand All @@ -45,7 +48,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,6 +67,8 @@
variable_05 = "Ezequiel"

# COMPLETAR - INICIO
strings_concatenados =variable_01+variable_02+variable_03+variable_04+variable_05


# COMPLETAR - FIN

Expand All @@ -83,6 +88,7 @@
variable_04 = 4

# COMPLETAR - INICIO
strings_concatenados =f"{variable_01}{variable_02}{variable_03}{variable_04}"

# COMPLETAR - FIN

Expand Down
Loading