from tkinter import * def click(event): root.configure(bg= '#ffffff') def click1(event): root.configure(bg= '#000000') root = Tk() root.title("Python") root.geometry('400x250') root.configure(bg= '#ff5f00') b = Button(root, text="Білий") b.grid(column=0, row=0) b.bind("", click) b1 = Button(root, text="Чорний") b1.grid(column=0, row=1) b1.bind("", click1) root.mainloop()