To find the area of a parallelogram in python, you can use the following formula:
area = base * height
where base
is the length of the base of the parallelogram and height
is the perpendicular distance between the base and the opposite side of the parallelogram.
Here's a python code snippet that calculates the area of a parallelogram:
main.py91 chars5 lines
Output:
main.py37 chars2 lines
In this example, we assume that the base of the parallelogram is 10 units long and the height is 5 units long. The program outputs the area of the parallelogram which is 50 square units.
gistlibby LogSnag