我不知道为什么当我试图跑步时出现。我试图解决但我无法解决。有什么错误吗?
import math
print(" Hello....\n This program will ask you to enter 3 numbers \n (a, b and c) that will be used in the quadratic formula to \n calculate the roots of an equation ")
a=float(input("Enter a Value for a: "))
while(a <= 0):
print(" Please enter a number that is larger than 0.") <br/>
a=float(input("Please enter a value for A: "))
b=float(input("Enter a Value for b: "))
while(b <= a): <br/>
print(" Please enter a value that is larger than A.") <br/>
b=float(input("Enter a value for B: "))
c=float(input("Enter a Value for C: "))
root1 = float(-b + math.sqrt(b * b - 4 * a * c)/(2 * a)) <br/>
root2 = float(-b - math.sqrt(b * b - 4 * a * c)/(2 * a))
print("Root 1 is " , root1)<br/>
print("Root 2 is " , root2)<br/>
input("prompt: ")
答案 0 :(得分:0)
首先:在Python中,缩进是必须的。嵌套代码缩进是一种语法特征,而不是用paranthesis'来源代码来源。
第二:显然,你从某个地方复制粘贴的HTML代码。摆脱<br />
。