Я ищу способ, с помощью которого я могу проверить, присутствует ли введенный пользователем набор синтаксиса в списке наборов.
Здесь '' ex_y '' список synsets в wordnet, которые имеют хотя бы один пример.
user_input = input("Enter the word:")
for index,i in enumerate(ex_y):
if user_input == i:
print("Word and Type:",ex_y[index].name())
print(" ")
print("Definition of the word:",ex_y[index].definition())
print(" ")
print("Example of the word:",str(ex_y[index].examples()))
print(" ")
else:
print("No word found, Kindly enter correct word!!!")
Я получаю ошибку для кода: if user_input == i:
Ошибка: AttributeError: у объекта 'str' нет атрибута '_name'