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
12 changes: 6 additions & 6 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,7 +34,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 +47,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 +60,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 +73,7 @@
diccionario = {} and {"Nombre": "Alberto Paz", "DNI": 12365855}

# COMPLETAR - INICIO

variable_06 = bool(diccionario)
# COMPLETAR - FIN

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

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

resultado= numero_1/7==0 and numero_2/7!=0
# COMPLETAR - FIN

assert resultado
assert resultado


"""
Expand All @@ -60,7 +60,7 @@
variable_05 = 100

# COMPLETAR - INICIO

resultado=(variable_01 or variable_02 or 1/0) - (variable_03+variable_05) - variable_05
# COMPLETAR - FIN

assert resultado == 80
8 changes: 4 additions & 4 deletions exercises/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==persona_01)and(edad_01!=edad_02)
# COMPLETAR - FIN

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

# COMPLETAR - INICIO

comparar_marca_y_modelo= (marca_del_auto != "ford")and(modelo_de_auto <= 1998)
# COMPLETAR - FIN

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

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

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

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

import string


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 @@ -23,12 +26,12 @@
usar operadores).
"""

# "¡Mamá "
# "estoy concatenando "
# "strings!"
#"¡Mamá "
#"estoy concatenando "
#"strings!"

# COMPLETAR - INICIO

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

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

# COMPLETAR - INICIO

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

assert strings_concatenados == "Le debo 600 pesos a un amigo."
Expand All @@ -57,16 +61,15 @@
Restricción: Utilizar el método format.
"""

variable_01 = "Le debo "
variable_01 = "Le debo"
variable_02 = 6
variable_03 = " pesos a un amigo hace "
variable_04 = " años."
variable_03 = "pesos a un amigo hace"
variable_04 = "años."
variable_05 = "Ezequiel"

# COMPLETAR - INICIO

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

assert (
strings_concatenados == "Le debo 6 pesos a un amigo hace 6 años. Se llama Ezequiel"
)
Expand All @@ -83,7 +86,7 @@
variable_04 = 4

# COMPLETAR - INICIO

strings_concatenados= f'{variable_01 }{variable_02}{ variable_03}{variable_04}'
# COMPLETAR - FIN

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