if shape_b=="CUBE":
a=int(input("Please enter the measure of the edge of cube"))
volume=a*a*a
TSA=6a*a
CSA=4a*a
print(f"Volume of cube is {str(volume)}. TSA is {str(TSA)}. CSA is str{CSA}")`
错误; TSA = 6a * a ^ SyntaxError:语法无效
请帮帮我。
答案 0 :(得分:0)
您犯了一个小错误。 6a*a
替换为6*a*a
if shape_b=="CUBE":
a=int(input("Please enter the measure of the edge of cube"))
volume=a*a*a
TSA=6*a*a
CSA=4*a*a
print("Volume of cube is {}. TSA is {}. CSA is {}".format(volume, TSA, CSA))
答案 1 :(得分:0)
我认为您打算这样做:
TSA=6*a*a
CSA=4*a*a