World Languages, asked by choudharyrameah564, 3 months ago


4. Write a python code to input temperature in Fahrenheit and convert to degree Celsius ​

Answers

Answered by MudassiruddinAhmed
0

Answer:

temp = input("Input the temperature you like to convert? (e.g., 45F, 102C etc.) : ")

degree = int(temp[:-1])

i_convention = temp[-1]

if i_convention.upper() == "C":

result = int(round((9 * degree) / 5 + 32))

o_convention = "Fahrenheit"

elif i_convention.upper() == "F":

result = int(round((degree - 32) * 5 / 9))

o_convention = "Celsius"

else:

print("Input proper convention.")

quit()

print("The temperature in", o_convention, "is", result, "degrees.")

Explanation:

Hope it helps

you can copy the code

mark my answer as brainlist:)

Answered by baapyor123123
0

Explanation:

Python Code:

upper() == "F": result = int(round((degree - 32) * 5 / 9)) o_convention = "Celsius" else: print("Input proper convention.") quit() print("The temperature in", o_convention, "is", result, "degrees.")

Similar questions