Вот решил учить питон, и написать программу для решения дискриминанта. Python\Tk.
------------------------------------------------------
Traceback (most recent call last):
File «work/pydisc.py», line 32, in <module>
btn = tkinter.Button(text = «Discrim», command = discrim(arg_a, arg_b, arg_c)).pack()
File «work/pydisc.py», line 7, in discrim
float(dis = (b ** 2) - (4 * a * c))
TypeError: unsupported operand type(s) for ** or pow(): 'NoneType' and 'int
------------------------------------------------------
import math
import tkinter
def discrim(a, b, c):
float(dis = (b ** 2) - (4 * a * c))
if (dis == 0):
x = (-b) / (2 * a)
print("один корень\n" + "x: " + str(x))
elif (dis > 0):
x_one = (-b + math.sqrt(dis)) / (2 * a)
x_two = (-b - math.sqrt(dis)) / (2 * a)
print("x1: " + str(x_one) + "\n")
print("x2: " + str(x_two) + "\n")
else:
print("нет вещественного решения\n")
root = tkinter.Tk()
root.geometry("500x500")
root.title("PyDiscrim")
tkinter.Label(text = "Заполните поля\n и нажмите на кнопку").pack(side = "top")
tkinter.Label(text = "a: ").pack(side = "top")
arg_a = tkinter.Entry(background = 'white', foreground = 'black').pack(side = "top")
tkinter.Label(text = "b: ").pack(side = "top")
arg_b = tkinter.Entry(background = 'white', foreground = 'black').pack(side = "top")
tkinter.Label(text = "c: ").pack(side = "top")
arg_c = tkinter.Entry(background = 'white', foreground = 'black').pack(side = "top")
btn = tkinter.Button(text = "Discrim", command = discrim(arg_a, arg_b, arg_c)).pack()
root.mainloop()
[\code]