From 436dda4c1c9ece40d84da4951b23527424b334df Mon Sep 17 00:00:00 2001 From: Sujith Date: Thu, 2 Mar 2023 01:13:17 +0530 Subject: [PATCH] feat: added python example for Temperature conversion --- _sources/lectures/TWP40/TWP40_12.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/_sources/lectures/TWP40/TWP40_12.rst b/_sources/lectures/TWP40/TWP40_12.rst index a1dd11bd3b..6f02b7b413 100644 --- a/_sources/lectures/TWP40/TWP40_12.rst +++ b/_sources/lectures/TWP40/TWP40_12.rst @@ -20,3 +20,12 @@ Conversión de grados usando C C = 5.0 * (F - 32.0) / 9.0; printf("Celsius: %2.1f\n", C); } + +Conversión de grados usando Python +---------------------------------- + +.. code-block:: python + + F = float(input("Farenheit: ")) + C = 5.0 * (F - 32.0) // 9.0 + print("Celsius: %2.1f" % C) \ No newline at end of file