Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while True:
- print(" ")
- print("ax^2+bx+c ausrechen UwU, Bitte Achte!!! Bei Kommazahlen . benutzen, nicht , Beispiel: 0.5 0.7 1.6")
- import time
- print("Auf ein Neues?")
- U1 = input("input a ")
- I1 = input("input b ")
- O1 = input("input c ")
- if (U1.isalpha() or I1.isalpha() or O1.isalpha()) is False:
- print("doing some math")
- a = float(U1)
- b = float(I1)
- c = float(O1)
- if ((b * b) - (4 * a * c)) > 0:
- q = float(((b * b) - (4 * a * c)) ** (1 / 2))
- x = float(2 * a)
- y = float(-1 * b)
- z = float(q * (-1))
- result1 = str((y + q) / x)
- result2 = str((y + z) / x)
- print("Nullstelle1=" " " + result1 + "")
- print("Nullstelle2=" " " + result2 + "")
- abc = float((-1 * b) / (2 * a))
- Moo = float((4 * a * c) - (b ** 2)) / (4 * a)
- cba = str(abc)
- oom = str(Moo)
- print("Scheitelpunkt: (" + cba + "|" + oom + ")")
- if (a > 0) is True:
- print("Nach oben geöffnete Funktion")
- print("Schnittpunkt mit der Y-Achse ist" " " + O1 + " ")
- else:
- print("Nach unten geöffnete Funktion")
- print("Schnittpunkt mit der Y-Achse ist" " " + O1 + " ")
- else:
- print("sorry, geht nicht da eine negative zahl unter der wurzel sein würde")
- time.sleep(3)
- else:
- print("nur Zahlen bitte")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement