color = ["Black", "Blue", "Green", "Red", "Purple", "Yellow", "Orange"]
score = 0
time_left = 30
def start_game(event):
if time_left == 30:
countdown()
next_color()
def next_color():
global score
global time_left
if time_left > 0:
if color_entry. get(). lower() == color[1]. lower():
score += len(color_entry. get(). lower())
color_entry. delete(0, END)
random. shuffle(color)
color_label. configure(text=f"{color[0]}", fg = color[1])
score_label. configure(text=f"Счет: {score}")
def countdown():
global time_left
if time_left > 0:
time_left -= 1
time_label. configure(text = f"Осталось: {time_left}")
time_label. after(1000, countdown)
window = Tk()
window. geometry("375x200")
info_label = Label(text = "Введите в поле ввода цвет, которым написно название цвета")
info_label. pack()
score_label = Label(text = f"Счет: {score}")
score_label. pack()
time_label = Label(text = f"Осталось: {time_left}")
time_label. pack()
color_label = Label(text = "Black", font = ("Tahoma", 36))
color_label. pack()
color_entry = Entry()
color_entry. pack()
window. bind(' ', start_game)
window. mainloop()
не уверен в том, что это сработает, но в твоём коде даже нет табуляции, поэтому нельзя проверить правильность