Write a program calculate_perimeter.py
that uses two functions to calculate the perimeter of a rectangle. The first function, get_length_width()
, asks the user to enter the length and width of a rectangle and returns those values to the main()
program.
The second function, get_perimeter()
, takes two values as parameters, calculates the perimeter, and returns that result to the main()
program.
The main()
program then prints out the perimeter of the rectangle.
Sample output:
Enter the length of a rectangle: 3
Enter the width of the rectangle: 7
The perimeter of this rectangle is: 20