Building a rule-based chatbot in Python