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+32print("Temperature in Fahrenheit:", fahrenheit)

Try it on Programming Hero

  Next Page  

tags: programming-heropythonpython3problem-solvingprogrammingcoding-challengeinterviewlearn-pythonpython-tutorialprogramming-exercisesprogramming-challengesprogramming-fundamentalsprogramming-contestpython-coding-challengespython-problem-solving

close