Sure, here is an example of a program in Python that calculates the perimeter of a rectangle:
def calculate_perimeter(length, width): perimeter = 2 * (length + width) return perimeter length = float(input("Enter the length of the rectangle: ")) width = float(input("Enter the width of the rectangle: ")) perimeter = calculate_perimeter(length, width) print(f"The perimeter of the rectangle is: {perimeter}")
You can run this program and enter the length and width of the rectangle when prompted, and it will calculate and print out the perimeter of the rectangle.
Sure, here is an example of a program in Python that calculates the perimeter of a rectangle:
def calculate_perimeter(length, width):perimeter = 2 * (length + width)
return perimeter
length = float(input("Enter the length of the rectangle: "))
width = float(input("Enter the width of the rectangle: "))
perimeter = calculate_perimeter(length, width)
print(f"The perimeter of the rectangle is: {perimeter}")
You can run this program and enter the length and width of the rectangle when prompted, and it will calculate and print out the perimeter of the rectangle.