from tkinter import * root = Tk() root.geometry("1000x600") root.title("Подсчет числа слогов в строке") word = Entry(root, width=50) word.pack() word.insert(0, "Введите слово: ") syllable_count=0 def syllable_count() : if word.get in 'аиеёоуыэюяАИЕЁОУЫЭЮЯ': syllable_count = syllable_count + 1 b=Button(root,text='Подсчитать',command=syllable_count) b.pack() root.mainloop()
Exception in Tkinter callback
Traceback (most recent call last):
File “C:\Users\vovac\AppData\Local\Programs\Python\Python310\lib\tkinter\__init__.py”, line 1921, in __call__
return self.func(*args)
File “E:\pythonProject123\qwe.py”, line 12, in syllable_count
if word.get in ‘аиеёоуыэюяАИЕЁОУЫЭЮЯ’:
TypeError: ‘in <string>’ requires string as left operand, not method
Traceback (most recent call last):
File “E:\pythonProject123\qwe.py”, line 17, in <module>
root.mainloop()
File “C:\Users\vovac\AppData\Local\Programs\Python\Python310\lib\tkinter\__init__.py”, line 1458, in mainloop
self.tk.mainloop(n)
KeyboardInterrupt