Write a Python program for each of the following cases. Case 2: Calculate perimeter or area of a rectangle. The main aim of this program is to calculate the area or perimeter of a rectangle based on the input from the user. The user can choose whether to calculate the area or perimeter. The general algorithm is as follows:
- Ask the user to choose either the perimeter or area of a rectangle calculation.
- Ask the user to input the lengths of the sides of the rectangle.
- Calculate the perimeter or area based on the earlier user input.
- Display the result using the following format: "The area of the rectangle is {value}" or "The perimeter of the rectangle is {value}".
- Ask the user whether to repeat or exit the program.