Skip to content

kendreanushka/chatbot-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

🤖 Simple Python Chatbot

A basic rule-based chatbot built with Python that responds to predefined user inputs using keyword matching.

📋 Description

This is a beginner-level Python chatbot that uses a dictionary of hardcoded question-answer pairs to simulate conversation. It matches user input against known keywords and returns a corresponding response.

🚀 Features

  • Responds to greetings and farewells
  • Answers basic general knowledge questions
  • Solves simple arithmetic expressions
  • Case-insensitive input handling
  • Fallback response for unrecognized inputs

🛠️ Tech Stack

  • Language: Python 3.x
  • Libraries Used: random (built-in)

▶️ How to Run

  1. Make sure Python is installed on your system.
  2. Clone or download this repository.
  3. Open a terminal and navigate to the project folder.
  4. Run the script:
python chatbot.py
  1. Start chatting! Type bye to exit.

💬 Sample Conversation

Chatbot: Hello! I'm a simple chatbot. You can start a conversation, or type 'bye' to exit. You: hello Chatbot: Hello! How can I help you? You: tell me a joke Chatbot: Why did the scarecrow win an award? Because he was outstanding in his field! You: 2+2= Chatbot: 4 You: bye Chatbot: Goodbye!


📁 Project Structure

📦 simple-chatbot ┗ 📜 chatbot.py


⚠️ Limitations

  • Only responds to predefined inputs — no NLP or AI involved
  • Cannot handle complex or multi-turn conversations
  • Arithmetic is hardcoded, not computed dynamically

🔮 Future Improvements

  • Add NLP using nltk or transformers
  • Integrate a machine learning model for dynamic responses
  • Add more topic coverage
  • Build a simple GUI using tkinter

👩‍💻 Author

Anushka Kendre

About

Created a chatbot backend in pyhton

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages