Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 台形の面積をコマンドライン入力から求める
a = input("上辺? ")
a = float(a)
b = input("下辺? ")
b = float(b)
h = input("高さ? ")
h = float(h)
daikei = (a + b) * h / 2
print("台形の面積は", daikei, "cm2")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment