Put the lesson Introduction to Functions into practice by writing a program yourself.
Melting points are usually listed in °C, but many formulas need kelvin. Instead of repeating + 273.15 everywhere, write a function that does the conversion.
Then use it to report the melting points of aluminium (660 °C), copper (1085 °C) and iron (1538 °C) in kelvin.
celsius_to_kelvin(temperature_c) that returns the temperature in kelvin.Aluminium: 933.15 K.Aluminium: 933.15 K Copper: 1358.15 K Iron: 1811.15 K
Write your program below and press Run. Each run is checked against the expected output.
Press Run to see what your program prints.
One possible solution. Other programs that print the same output are correct too.
def celsius_to_kelvin(temperature_c): """Convert a temperature from °C to K.""" return temperature_c + 273.15print(f"Aluminium: {celsius_to_kelvin(660):.2f} K")print(f"Copper: {celsius_to_kelvin(1085):.2f} K")print(f"Iron: {celsius_to_kelvin(1538):.2f} K")