prog7_4.py

def area_triangle(base, height):
    area = base * height / 2
    return area

b = float(input("三角形の底辺の長さは?"))
h = float(input("高さは?"))
s = area_triangle(b, h)
print(f"面積は{s}です!")

# プログラム7-4(三角形の面積を求める関数)