コードの間違った部分を見つけるのを手伝ってもらえますか?私はいくつかのことを試してみました。このサイトで検索が、私はあなたたちが何かを知っていれば、それは知らせてください...解決策を見つけることができませんでした:DTypeError:並べ替えることのできない型:str()<= int()エラー
print("Uw formule is ax**2+bx+c")
a= float(input("Geef getal a:"))
b= float(input("Geef getal b:"))
c= float(input("Geef getal c:"))
D=b**2-4*a*c
while (D<=0) or (a==0):
print("Voer nieuwe getallen in, de uitkomst is niet te berekenen")
a= float(input("Geef getal a:"))
b= float(input("Geef getal b:"))
c= float(input("Geef getal c:"))
D=b*b-4*a*c
D= format(D,'.1f')
if (D>0):
print("\nDe discriminant is:", D)
x1= (-b-(D)**0.5)/(2*a)
x1= format(x1,'.1f')
x2= (-b+(D)**0.5)/(2*a)
x2= format(x2,'.1f')
print("De uitkomst van x1=", x1)
print("De uitkomst van x2=", x2)
その後エラー:
Traceback (most recent call last):
File "*****", line 15, in <module>
while (D<=0) or (a==0):
TypeError: unorderable types: str() <= int()
このサイトでは、すべての有用な答えをupvotingで感謝を示す。答えの左上にある上向き矢印をクリックすると、そのようになります。さらに、回答の左上隅にあるチェックマークをクリックして最善の回答を受け入れます。それはコメントでお礼を言うよりも優れています。 –