diff --git a/_sources/lectures/TWP40/TWP40_12.rst b/_sources/lectures/TWP40/TWP40_12.rst index e7b79acae4..b05e8ab193 100644 --- a/_sources/lectures/TWP40/TWP40_12.rst +++ b/_sources/lectures/TWP40/TWP40_12.rst @@ -15,20 +15,22 @@ Conversión de grados usando C int main(void){ float F, C; - printf("Farenheit: "); + printf("Fahrenheit: "); scanf("%f", &F); C = 5.0 * (F - 32.0) / 9.0; printf("Celsius: %2.1f\n", C); } Conversión de grados usando Python ----------------------------------- +----------------------------------- + ++ Ahora vamos a convertir el programa anterior a Python. .. code-block:: python - F = float(input("Farenheit: ")) - C = 5.0 * (F - 32.0) // 9.0 - print("Celsius: %2.1f" % C) + F = float(input("Fahrenheit: ")) + C = 5.0 * (F - 32.0) / 9.0 + print("Celsius: %2.1f" % C) .. poll:: TWP40 :scale: 3 diff --git a/_sources/lectures/TWP40/TWP40_12_en.rst b/_sources/lectures/TWP40/TWP40_12_en.rst index 448a2e1f04..d9f690a3b1 100644 --- a/_sources/lectures/TWP40/TWP40_12_en.rst +++ b/_sources/lectures/TWP40/TWP40_12_en.rst @@ -21,6 +21,17 @@ Converting degrees using C printf("Celsius: %2.1f\n", C); } +Converting degrees using Python +---------------------------------- + ++ Now we will convert the previous program to Python. + +.. code-block:: python + + F = float(input("Fahrenheit: ")) + C = 5.0 * (F - 32.0) / 9.0 + print("Celsius: %2.1f" % C) + .. poll:: TWP40E :scale: 3 :allowcomment: