base1 = float(input("Enter the length of the first base of the trapezium: ")) base2 = float(input("Enter the length of the second base of the trapezium: ")) height = float(input("Enter the height of the trapezium: ")) side1 = float(input("Enter the length of the first side of the trapezium: ")) side2 = float(input("Enter the length of the second side of the trapezium: "))
def calculate_trapezium_area(base1, base2, height):
area = 0.5 (base1 + base2) height
return area
def calculate_trapezium_perimeter(base1, base2, side1, side2):
perimeter = base1 + base2 + side1 + side2
return perimeter
base1 = float(input("Enter the length of the first base of the trapezium: "))
base2 = float(input("Enter the length of the second base of the trapezium: "))
height = float(input("Enter the height of the trapezium: "))
side1 = float(input("Enter the length of the first side of the trapezium: "))
side2 = float(input("Enter the length of the second side of the trapezium: "))
area = calculate_trapezium_area(base1, base2, height)
perimeter = calculate_trapezium_perimeter(base1, base2, side1, side2)
print("The area of the trapezium is: {:.2f}".format(area))
print("The perimeter of the trapezium is: {:.2f}".format(perimeter))