import math
def maths():
shape=input("Choose a shape:Square, Circle or Triangle ")
if shape == "Triangle" or "triangle":
triangleb = int(input("How many cm's is the base of your triangle? "))
triangleh = int(input("How many cm's is the height of your triangle? "))
t_area = triangleb*triangleh / 2
print("The area of your triangle is",t_area)
print("")
maths()
elif shape == "Circle" or "circle":
circle=int(input("What is the radius of your circle? "))
c_area=math.pi*circle*circle
c_arearound=round(c_area ,2)
print("The area of your circle is",c_arearound,"(rounded to 2 decimal places)")
print("")
maths()
elif shape == "square" or "Square":
square=int(input("How many cm is one side of your square "))
s_area=square*square
print("The area of your square is",s_area)
print("")
maths()
else:
print("invalid answer")
maths()
maths()
IF语句的每个元素在以' if开头时都能正常工作。问题是,如果我输入' circle'将出现三角形的代码。例如,我会输入圆圈,它会说“你的三角形的底部有多少厘米?”'。无论我输入什么,无论是圆形还是方形,它都会打印出三角形代码。如果我切换' if'圆形而不是三角形的语句完全相同。我可以输入三角形或正方形,无论输入是什么,它都只会运行圆形代码。为什么?