Почему получаю ошибку неправильный тип данных? Сообщает, что в get возвращается тип str? Но почему, все же указано как надо...или нет?
Вот сам код: https://pastebin.com/1kRckN8y
from tkinter import *
from math import *
def setwindow(root):
root.title('Окно программы')
root.resizable(False, False)
w = 800
h = 600
ws = root.winfo_screenwidth()
wh = root.winfo_screenheight()
x = int(ws / 2 - w / 2)
y = int(wh / 2 - h / 2)
root.geometry("{0}x{1}+{2}+{3}".format(w, h, x, y))
def equation():
global a
global b
global c
global result
x1 = str(float(b.get() * -1) + float(sqrt(b.get() ** 2 - float(a.get() * c.get() * 4) / float(a.get() * 2))))
x2 = str(float(b.get() * -1) - float(sqrt(b.get() ** 2 - float(a.get() * c.get() * 4) / float(a.get() * 2))))
result.config(text="x1 = " + x1 + "; " + "x2 = " + x2)
root = Tk()
setwindow(root)
label_main = Label(root, text='ax^2 + bx + c = 0', font='tahoma 20')
a = Entry(root, font='Tahoma 16')
c = Entry(root, font='Tahoma 16')
result = Label(root, font='Tahoma 18')
but = Button(root, text='Вычеслить корень уравнения ', font='Tahoma 20', command=equation)
labela = Label(root, text='a', font='Tahoma 16')
labelb = Label(root, text='b', font='Tahoma 16')
labelc = Label(root, text='c', font='Tahoma 16')
label_main.place(relx=0.5, rely=0.01, anchor='n')
a.place(relx=0.5, rely=0.1, anchor='n')
b.place(relx=0.5, rely=0.2, anchor='n')
c.place(relx=0.5, rely=0.3, anchor='n')
labela.place(relx=0.3, rely=0.09, anchor='n')
labelb.place(relx=0.3, rely=0.19, anchor='n')
labelc.place(relx=0.3, rely=0.29, anchor='n')
but.place(relx=0.5, rely=0.5, anchor='n')
root.mainloop()
Черт, акелла промахнулся. Не тот кусок кода https://pastebin.com/1kRckN8y
b.place(relx=0.5, rely=0.2, anchor='n')
->NameError: name 'b' is not defined