這是我的程序到目前爲止,有人能告訴我我做了什麼錯誤或給我一個修復它嗎?這一切都在蟒蛇,我真的很感激答案。彈出錯誤消息說:「不能通過類型爲'str'的非整數來乘序列」。如何讓我的程序計算三角形的面積?在Python
height = input("What is the height of the triangle? ")
width = input("What is the width of the triangle? ")
area = width * height /2
print("The area of the triangle would be {0:f} ".format(area))
'嘗試轉換成int' – The6thSense
你是什麼意思轉換爲int? – BlizzardGizzard
見下面答案:) – The6thSense