Skip to content

Commit

Permalink
Cambios
Browse files Browse the repository at this point in the history
  • Loading branch information
indadominguez committed Oct 18, 2024
1 parent 6c24d39 commit 06a7b5d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8 deletions.
7 changes: 4 additions & 3 deletions src/ej01_def.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ def dar_bienvenida(nombre):

return f"Hola, {nombre}!"

if __name__ == "__main__":

nombre_usuario = input("Por favor, ingresa tu nombre: ")
nombre_usuario = input("Por favor, ingresa tu nombre: ")


mensaje_bienvenida = dar_bienvenida(nombre_usuario)
mensaje_bienvenida = dar_bienvenida(nombre_usuario)


print(mensaje_bienvenida)
print(mensaje_bienvenida)
4 changes: 2 additions & 2 deletions src/ej04.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

temperatura_celsius = float(input("Por favor, introduce la temperatura en grados Celsius: "))

# Convertir la temperatura a grados Fahrenheit

temperatura_fahrenheit = (temperatura_celsius * 9/5) + 32

# Mostrar la temperatura convertida con el formato requerido

print(f"La temperatura en grados Fahrenheit es {temperatura_fahrenheit:.2f}ºF ({temperatura_celsius:.2f}ºC)")
2 changes: 1 addition & 1 deletion src/ej09.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

print(f"{sum(float(input(f'Ingresa el número {i+1}: ')) for i in range(3)):.2f}")

# Me queaba muy largo el print si no utilizaba un for.
# Me quedaba muy largo el print si no utilizaba un for.
2 changes: 1 addition & 1 deletion src/ej25.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
mes = partes_fecha[1].zfill(2)
año = partes_fecha[2]

# Mostrar el resultado

print(f"Día: {dia}, Mes: {mes}, Año: {año}")
2 changes: 1 addition & 1 deletion tests/test_ej01.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from src.ej01_def import dar_bienvenida

def test_dar_bienvenida():
assert dar_bienvenida("Indalecio") == ("Hola, Indalecio")
assert dar_bienvenida("Indalecio") == ("Hola, Indalecio!")
16 changes: 16 additions & 0 deletions tests/test_ej04.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import pytest
from src.ej04_def2 import grados_celsius

@pytest.mark.parametrize(
"input_x, expected",
[
(32, 0.0),
(145, 62.78),
(122, 50)
]
)
def test_grados_celsius(input_x, expected):
assert grados_celsius(input_x) == expected


0 comments on commit 06a7b5d

Please sign in to comment.