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
12 changes: 7 additions & 5 deletions _sources/lectures/TWP40/TWP40_12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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: "))
Comment thread
abadoni5 marked this conversation as resolved.
C = 5.0 * (F - 32.0) / 9.0
print("Celsius: %2.1f" % C)

.. poll:: TWP40
:scale: 3
Expand Down
11 changes: 11 additions & 0 deletions _sources/lectures/TWP40/TWP40_12_en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down