Немного переделал, осталось допилить, например в слове эффект, две “ф” программа не обрабатывает и если правильных четыре нажал, даже одну и ту же букву то выиграл
#coding: utf-8 from Tkinter import * root = Tk() canvas = Canvas(root, width=600, height=600) canvas.pack(fill=BOTH) word = u'абвгде' y = 0 while y < 600: x=0 while x < 600: canvas.create_rectangle(x,y,x+33,y+27, fill="white", outline="blue") x=x+33 y = y + 27 a1 = canvas.create_text(315,40, text=word[0], fill="purple", font=("Helvectica", "16")) a2 = canvas.create_text(347,40, text='_', fill="purple", font=("Helvectica", "18")) a3 = canvas.create_text(380,40, text='_', fill="purple", font=("Helvectica", "18")) a4 = canvas.create_text(412,40, text='_', fill="purple", font=("Helvectica", "18")) a5 = canvas.create_text(444,40, text='_', fill="purple", font=("Helvectica", "18")) a6 = canvas.create_text(477,40, text=word[-1], fill="purple", font=("Helvectica", "16")) list1 = [1,2,3,4,5,6] alfabet = u'абвгдеёжзийклмнопрстуфхцчшщъыьэюя' canvas.create_line(10,10,200,10,width=4) canvas.create_line(10,10,10,400,width=4) canvas.create_line(50,10,10,100,width=4) er = [] win = [] def a(v): ind_alf = alfabet.index(v) key = alfabet[ind_alf] if v in word: ind = word.index(v) b2 = list1[ind] if b2 == 1: btn[key]["bg"] = "green" pass if b2 == 6: btn[key]["bg"] = "green" pass if b2 == 2: win.append(v) a2 = canvas.create_text(347,40, text=word[1], fill="purple", font=("Helvectica", "18")) btn[key]["bg"] = "green" elif b2 == 3: win.append(v) a3 = canvas.create_text(380,40, text=word[2], fill="purple", font=("Helvectica", "18")) btn[key]["bg"] = "green" elif b2 == 4: win.append(v) a3 = canvas.create_text(412,40, text=word[3], fill="purple", font=("Helvectica", "18")) btn[key]["bg"] = "green" elif b2 == 5: win.append(v) a3 = canvas.create_text(444,40, text=word[4], fill="purple", font=("Helvectica", "18")) btn[key]["bg"] = "green" if len (win) == 4: canvas.create_text(150,150, text="You win", fill="purple", font=("Helvectica", "16")) else: er.append(v) btn[key]["bg"] = "red" if len(er) == 1: golova() elif len(er) == 2: telo() elif len(er) == 3: rukaL() elif len(er) == 4: rukaP() elif len(er) == 5: nogaL() elif len(er) == 6: nogaP() end() root.update() btn = {} def gen(u,x,y): btn[u] = Button(root , text = u, width=3, height=1, command = lambda: a(u)) btn[u].place(x=str(x),y=str(y)) x = 265 y = 110 for i in alfabet[0:8]: gen(i,x,y) x=x+33 x = 265 y=137 for i in alfabet[8:16]: gen(i,x,y) x=x+33 x = 265 y=164 for i in alfabet[16:24]: gen(i,x,y) x=x+33 x = 265 y=191 for i in alfabet[24:33]: gen(i,x,y) x=x+33 def golova(): canvas.create_oval(79,59,120,80, width=4, fill="white") root.update() def telo(): canvas.create_line(100,80,100,200,width=4) root.update() def rukaP(): canvas.create_line(100,80,145,100,width=4) root.update() def rukaL(): canvas.create_line(100,80,45,100,width=4) root.update() def nogaL(): canvas.create_line(100,200,45,300,width=4) root.update() def nogaP(): canvas.create_line(100,200,145,300,width=4) root.update() def end(): canvas.create_text(150,150, text="The end", fill="purple", font=("Helvectica", "16")) canvas.create_line(100,10,100,60,width=4) root.mainloop()