Write a program to take a depthin Kilometersinside the earth

Write a program to take a depth(in Kilometers)inside the earth as input data; compute and display the temperature at this depth in degree Celsius and degrees Fahrenheit. The relevant formulas are Celsius = 10 (depth) + 20 Fahrenheit = 1.8 (Celsius) + 32 Include two functions in your program. Function celsius_at_depth should compute and return the Celsius temperature at a depth measured in Kilometers. Function Fahrenheit should convert a Celsius temperature to Fahrenheit.

Solution

def celsius_at_depth(depth):
   return (10*depth)+20
def fahrenheit(celsius):
   return (celsius*1.8)+32

depth = int(input(\"Enter Depth:\"))
print \"celsius at Depth {0} -> {1}\".format(depth,celsius_at_depth(depth))
print \"In fahrenheit -> \",fahrenheit(celsius_at_depth(depth))

\"\"\"
Sample output
Enter Depth: 10
celsius at Depth 10 -> 120
In fahrenheit -> 248.0
\"\"\"

 Write a program to take a depth(in Kilometers)inside the earth as input data; compute and display the temperature at this depth in degree Celsius and degrees F

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site