Correct the following code in Python. It should implement the formula
TC=100180(TF−32).TC=100180(TF−32).
There are at least two errors that need to be corrected.
T_F = 212 T_C = 100 // 180 * T_F - 32 print( T_C ) # T_C should now equal 100
The corrected code is provided below:
Screenshot of the code:
Sample Output:
Code To Copy:
#Run the code in python version 3.x.
#Declare the temperature in Fahrenheit.
T_F = 212
#Replace // to / which is the division operator.
#Compute the temperature in Celsius.
T_C = 100 / 180 * (T_F - 32)
#Display the temperature in Celsius.
print( T_C )
Get Answers For Free
Most questions answered within 1 hours.