S
S
sdrom2020-09-19 18:09:51
Python
sdrom, 2020-09-19 18:09:51

How to make the bot work properly?

When writing a query, only the first command is triggered

print("-------=регистрация=------------------------")
name = input("Ваше имя: ")
print("________________________________")
family = input("Ваша фамилия: ")
print("________________________________")
age = input("ваш возраст: ")
print("=___Регистрация_окончена._Теперь_можем_пообщатся.________________________=")

#опрос
print("<Виталий>:      О чём поболтаем?")
answer = input("<Вы>: ")
#вопросы
if answer == "привет" or "Привет" or "привет." or "Привет." or "Добрый день." or "Добрый день!" or "добрый день" or "добрый день." or "Здравствуйте!" or "Здравствуйте." or "здравствуйте." or "здравствуйте!":
    print("<Виталий>:       Добрый день,", name, "! Как дела?")
    answer = input("<Вы>: ")

if answer == "как дела" or "Как дела?" or "Что делаешь?" or "что делаешь?" or "что делаешь" or "Чем занимаешся?" or "Как делишки?" or "Что делаете?" or "Почему ты растроен?" or "Как ты?" or "Что свами?" or "что делате":
    print("<Виталий>:       Прекрасно! Общаюсь свами, набираюсь опыту.")
    answer = input("<Вы>: ")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-09-19
@sdrom

How to force a developer to read the documentation
bot thinks. Using OR
incorrectly Each or is a new condition. https://pythontutor.ru/lessons/ifelse/
if answer == "привет" or answer == "Привет"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question