-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
faa22e1
commit 6c24d39
Showing
8 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# ejercicio 4_def_2 | ||
|
||
def grados_celsius(fahrenheit: float) -> float: | ||
|
||
celsius = (fahrenheit - 32) * 5/9 | ||
|
||
return round(celsius, 2) | ||
|
||
def convertir_temperatura(): | ||
|
||
fahrenheit = float(input("Introduce la temperatura en grados Fahrenheit: ")) | ||
|
||
celsius = grados_celsius(fahrenheit) | ||
|
||
resultado = f"{fahrenheit:.2f}ºF ({celsius:.2f}ºC)" | ||
|
||
return resultado | ||
|
||
def main(): | ||
|
||
resultado = convertir_temperatura() | ||
print(resultado) | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# prueba 1 | ||
|
||
def num_mayor(num1, num2): | ||
if num1 > num2: | ||
return num1 | ||
elif num2 > num1: | ||
return num2 | ||
else: | ||
return 0 | ||
|
||
def main(): | ||
numero1 = float(input("Ingrese el primer número: ")) | ||
numero2 = float(input("Ingrese el segundo número: ")) | ||
resultado = num_mayor(numero1, numero2) | ||
print(f"El resultado es: {resultado:.2f}") | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import pytest | ||
from src.ej01_def import dar_bienvenida | ||
|
||
def test_dar_bienvenida(): | ||
assert dar_bienvenida("Indalecio") == ("Hola, Indalecio") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import pytest | ||
from src.ej02_def import calcular_importe_total | ||
|
||
@pytest.mark.parametrize( | ||
"input_x, input_y, expected", | ||
[ | ||
(4, 2, 8), | ||
(1, 3, 3), | ||
(2, 2, 4) | ||
] | ||
) | ||
def test_calcular_importe_total(input_x, input_y, expected): | ||
assert calcular_importe_total(input_x, input_y) == expected | ||
|
||
|
||
|
||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import pytest | ||
from src.prueba1 import num_mayor | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"input_x, input_y, expected", | ||
[ | ||
(0, 0, 0), | ||
(2, 1, 2), | ||
(1, 2, 2) | ||
] | ||
) | ||
def test_num_mayor(input_x, input_y, expected): | ||
assert num_mayor(input_x, input_y) == expected |