Question: # !/usr/bin/env python3 This following code does not work for some reason could you help me figure out the problem and also I am trying
# !/usr/bin/env python3 This following code does not work for some reason could you help me figure out the problem and also I am trying to do this code in c++ but I don't know-how
# Created by: Ahmad El-khawaldeh
# Created on: Dec 2020
# This program calculates the area of tringle
print(" calculate the area of a trapzoid ")
def calculate_area_of_trapziod(Base1_string, Base2_string, Height_string):
Base1 = int(Base1_string)
Base2 = int(Base2_string)
Height = int(height_string)
area = 0.5 * (Base1 + Base2) * Height
print(" The area of the trapezoid is {} mm2 ".format(area))
def main():
try:
Base1_string = input('Enter the base1(cm): ')
Base2_string = input('Enter Base2(cm): ')
Height_string = input('Enter the height(cm): ')
calculate_area_of_trapziod(Base1_string, Base2_string, Height_string)
except Exception:
print("This is not a number")
if __name__ == "__main__":
main()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
