{"id":18963,"date":"2021-08-29T15:13:04","date_gmt":"2021-08-29T09:43:04","guid":{"rendered":"https:\/\/python-programs.com\/?p=18963"},"modified":"2021-11-22T18:37:10","modified_gmt":"2021-11-22T13:07:10","slug":"python-program-to-compute-the-perimeter-of-trapezoid","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-compute-the-perimeter-of-trapezoid\/","title":{"rendered":"Python Program to Compute the Perimeter of Trapezoid"},"content":{"rendered":"

In the previous article, we have discussed Python Program to Compute 1\/N!<\/a>
\nTrapezoid:<\/strong><\/p>\n

A trapezoid is a four-sided geometrical figure with two sides that are parallel to each other. the sides that are parallel to each other are referred to as the “base” The other sides are referred to as “legs” (which may or may not be equal).<\/p>\n

Formula to calculate Perimeter of a Trapezoid<\/strong> :<\/b><\/p>\n

Perimeter (P) = a+b+c+d<\/p>\n

where a, b = Bases of Trapezoid<\/strong> <\/b><\/p>\n

c, d = Side length of Trapezoid<\/strong><\/b><\/p>\n

Given the values of a, b, c, d, and the task is to calculate the perimeter of the given Trapezoid<\/strong><\/b>.<\/div>\n
Examples:<\/strong><\/div>\n
\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given a= 10\r\nGiven b= 20\r\nGiven c= 35\r\nGiven d= 45<\/pre>\n

Output:<\/strong><\/p>\n

The Trapezoid's perimeter with the given values of a,b,c,d { 10 20 35 45 } = 110<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given a= 43\r\nGiven b= 17\r\nGiven c=  25.5\r\nGiven d= 32<\/pre>\n

Output:<\/strong><\/p>\n

The Trapezoid's perimeter with the given values of a,b,c,d { 43 17 25.5 32 } = 117.5<\/pre>\n

Program to Compute the Perimeter of Trapezoid in Python<\/h2>\n

Below are the ways to calculate the perimeter of the given Trapezoid:<\/strong><\/b><\/p>\n