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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
50600 Clara Razzetto

# TUP Python Práctica 1

Este repositorio fue creado con la [Autograding Python Assignments
Expand Down
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 % 2)
# 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
19 changes: 14 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
# 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,7 +41,7 @@
numero_2 = 50

# COMPLETAR - INICIO

resultado = (numero_1 % 7) == 0 and (numero_2 % 7) != 0
# COMPLETAR - FIN

assert resultado
Expand All @@ -55,12 +55,21 @@

variable_01 = False
variable_02 = True
variable_03 = 80
variable_04 = "90"
variable_03 = 80
variable_04 = "90" #True
variable_05 = 100

# COMPLETAR - INICIO

# Usando and si todos los valores son True se devuelve el ultimo valor evaluado como True
resultado = not variable_01 and variable_02 and variable_04 and variable_05 and variable_03

#Usando and si hay un valor False, hay cortocircuito devuelve el valor False donde corta (No me da 80)
# resultado = variable_01 and variable_02 and variable_04 and variable_05 and variable_03

#Usando or si hay un valor True, hay cortocircuito develve el valor True donde corta
# resultado = variable_03 or variable_01 or variable_02 or variable_04 or 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_02) 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 <= 2000)
# 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 < 2*manzanas <= peras ** 2
# COMPLETAR - FIN

assert comparar_frutas
8 changes: 4 additions & 4 deletions exercises/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 = int(numero_01) + int(numero_02) + int(numero_03) + int(numero_04)
# COMPLETAR - FIN

assert suma_de_numeros == 1500
Expand All @@ -26,7 +26,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 +42,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 +59,7 @@
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
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,7 +64,8 @@
variable_05 = "Ezequiel"

# COMPLETAR - INICIO

strings_concatenados = "{0}{1}{2}{1}{3} Se llama {4}".format(variable_01, variable_02, variable_03, variable_04, variable_05)
strings_concatenados = "{v1}{v2}{v3}{v2}{v4} Se llama {v5}".format(v1=variable_01, v2=variable_02, v3=variable_03, v4=variable_04, v5=variable_05)
# COMPLETAR - FIN

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

# COMPLETAR - INICIO

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"
# assert strings_concatenados == "Le pagué 2 pesos que le debía a Ezequiel, me faltan $4"
Loading