In Zelle chapter 2, convert.py asked the user for a Celsius
temperature and printed out the equivalent Fahrenheit
temperature.
This assignment does the opposite conversion, interactively ask the
user for a Fahrenheit temperature and with appropriate explanatory
text print out the equivalent Celsius value.
Hint: If you do not know the FtoC formula, look it up with your
favorite search engine.
Remember to always name your file with last name.
# convert.py def CtoF(C): return ((9/5)*C) + 32 def FtoC(F): return (5/9)*(F-32) # Testing def main(): C = float(input("Enter temperature in celsius: ")) print("F =",CtoF(C)) F = float(input("Enter temperature in fahrenheit: ")) print("C =", FtoC(F)) main()
Get Answers For Free
Most questions answered within 1 hours.