Skip to content

Latest commit

 

History

History
30 lines (18 loc) · 1.04 KB

File metadata and controls

30 lines (18 loc) · 1.04 KB

4.2 Celsius to Fahrenheit

The problem

Take the temperature in degrees Celsius and convert it to Fahrenheit.

Hins:

To convert degrees Celsius temperature to Fahrenheit, you have to multiply by 9 and divide by 5.

And then, add 32.

Think for a second...How will you multiply a variable by 9 and then divide by 5? and then add 32. Can you do it without looking at the solution?

The solution

celsius = float(input("Enter temperature in degrees Celsius: "))
 
fahrenheit = celsius*9/5+32
 
print("Temperature in Fahrenheit:", fahrenheit)

Try it on Programming Hero

  Next Page  

tags: programming-hero python python3 problem-solving programming coding-challenge interview learn-python python-tutorial programming-exercises programming-challenges programming-fundamentals programming-contest python-coding-challenges python-problem-solving