Real Python's tutorial how to build a chat bot with help of ChatterBot library:
https://realpython.com/build-a-chatbot-python-chatterbot/
With ChatterBot library, you can build and train a self-learning chatbot with just a few lines of Python code.
In this tutorial, you’ll learn how to:
ChatterBot is a Python library that makes it easy to generate automated responses to a user’s input. ChatterBot uses a selection of machine learning algorithms to produce different types of responses. This makes it easy for developers to create chat bots and automate conversations with users.