Write a Python program to convert temperatures to and from celsius, fahrenheit.
[ Formula : c/5 = f-32/9 [ where c = temperature in celsius and f = temperature in fahrenheit ]
Expected Output :
60°C is 140 in Fahrenheit
45°F is 7 in Celsius
Expert's answer
t = input('Temperature = ')
t, v = t.split('°')
t = int(t)
if v.lower() == 'c':
f = t*(9/5) + 32print(f"{t}°C is {f:.0f} in Fahrenheit")
elif v.lower == 'f':
c = (t - 32)*5/9print(f"{t}°F is {c} in Celsius")
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!