199k views
0 votes
Using the celsius_to_kelvin function as a guide, create a new function, changing the name to kelvin_to_celsius, and modifying the function accordingly. Sample output with input: 283.15 10.0 C is 283.15 K 283.15 K is 10.0 C 1 def celsius_to_kelvin value.celsius): value_kelvin 0.0 value_kelvin - value.celsius + 273.15 return value kelvin DIO! 5 7. Your solution goes here 9 value c - 10.0 10 print(value.c, Cis', celsius.to kelvin(value.c), 'K) 12 value floatinput ) 13 print(value, Kis', kelvin_to_celsius(value. ). 'C"> Run

User Jimmy Huch
by
5.2k points

1 Answer

5 votes

Answer:

The function is as follows:

def kelvin_to_celsius(value_kelvin):

value_celsius = 0.0

value_celsius = value_kelvin - 273.15

return value_celsius

Step-by-step explanation:

This defines the function

def kelvin_to_celsius(value_kelvin):

This initializes value_celsius to 0

value_celsius = 0.0

This calculates value_celsius

value_celsius = value_kelvin - 273.15

This returns the calculated value_celsius

return value_celsius

User Daniel Neal
by
4.9k points