if length > 0 and width > 0:
# 判断长和宽是否相等
if length == width:
print("该方形为正方形")
else:
print("该方形为长方形")
else:
if length<0:
print("长度不合法")
if width<0:
print("宽度
if length > 0 and width > 0:
# 判断长和宽是否相等
if length == width:
print("该方形为正方形")
else:
print("该方形为长方形")
else:
if length<0:
print("长度不合法")
if width<0:
print("宽度不合法")
不合法")