?887 2022-08-01 10:19 采纳率: 97.8%
浏览 32
已结题

python运算符的计算

输入:
A = float(input("Enter the first number: "))
B = float(input("Enter the second number: "))
C = input("Enter the operator: ")
if C == "+":
Sum1 = A+B
print(A,"+",B,"=",round(Sum1,1))
elif C =="-":
Sum2 = A-B
print(A,"-",B,"=",round(Sum2,1))
elif C == "":
Sum3 = A
B
print(A,"*",B,"=",round(Sum3,1))
elif C == "/":
Sum4 = A/B
print=(A,"/",B,"=",round(Sum4,1))
else:
print("Operator not supported.")

img


输出的时候除法运算不出来,应该怎么去修改呢

  • 写回答

3条回答 默认 最新

  • 於黾 2022-08-01 10:26
    关注

    print=(A,"/",B,"=",round(Sum4,1))
    你自己看不出来多了个等号吗

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 8月9日
  • 已采纳回答 8月1日
  • 创建了问题 8月1日