1. The python code above is used to calculate area of a rectangle.
First of
all, the program asks the user to enter a real number for the length of
rectangle. Next, the function will require an input width of rectangle with a
real number type. After inputting the rectangle’s length and width, the
function shows the result on the terminal. Then, the area of rectangle is
calculated by multiply the length of rectangle by the width of rectangle.
Finally, the result will be displayed on the screen. Thanks to this program,
users can quickly know the area of rectangle.
2. The Python code above helps us to convert Celsius degrees to Kelvin.
Firstly, the program asks the user to input a real number for the Celsius
degree from the keyboard. Secondly, the program defines a function
named celsius_to_kelvin. This function is used to calculate Kelvin
temperature by adding the Celcius degree to 273.15. Then, the program
calls celsius_to_kelvin function to get Kelvin temperature with the input
variable being the Celsius degree value mentioned above. Finally, the
result will be displayed on the screen.