A console-based rule-based chatbot developed in Python as part of the CodeAlpha Python Programming Internship. This project demonstrates Python fundamentals, functions, loops, conditional logic, user input handling, modular programming, and file handling through the implementation of an interactive chatbot system.
The Basic Chatbot is a simple text-based conversational program that interacts with users through predefined responses.
The chatbot accepts user messages, analyzes the input, and provides appropriate responses based on a predefined response database. It supports basic conversations such as greetings, asking about its identity, checking available capabilities, and ending conversations.
This project was designed using clean coding practices with a modular structure by separating chatbot responses into an independent Python file and storing conversation history in a text file.
- 🤖 Interactive console-based conversation
- 👋 Greeting and farewell messages
- 💬 Predefined rule-based responses
- 🔍 User input normalization
- ❓ Handles unknown questions gracefully
- 📝 Saves complete chat history automatically
- 🕒 Records conversation date and time
- 🧩 Modular code organization
- 📚 Clean and documented Python code
- Python 3
- Git
- GitHub
- Visual Studio Code
CodeAlpha_Basic_Chatbot/
│
├── screenshots/
│ ├── start.png
│ ├── conversation.png
│ └── goodbye.png
│
├── .gitignore
├── LICENSE
├── README.md
├── requirements.txt
├── chatbot.py
├── responses.py
└── chat_history.txt
Make sure you have:
- Python 3.x installed
- Git installed (optional, for cloning)
git clone https://github.com/Helina-Leul/CodeAlpha_Basic_Chatbot.gitcd CodeAlpha_Basic_Chatbotpython chatbot.py- Start the application.
- The chatbot displays a welcome message.
- Type a message or question.
- The chatbot responds using predefined answers.
- Continue the conversation.
- Type:
bye
to end the conversation.
==================================================
CODEALPHA BASIC CHATBOT
==================================================
Hello! I'm your friendly chatbot.
Type 'bye' anytime to end the conversation.
==================================================
You: hello
Bot: Hello! Nice to meet you.
You: how are you
Bot: I'm doing great! Thanks for asking.
You: what is your name
Bot: I'm CodeAlpha ChatBot.
You: bye
Bot: Goodbye! Have a wonderful day.
This project strengthened my understanding of:
- Python variables and data types
- Dictionaries
- Functions
- Conditional statements
- Loops
- String manipulation
- User input handling
- File handling
- Modular programming
- Exception-free program flow
- Git and GitHub workflow
Through this project, I learned how to:
- Build an interactive console application using Python
- Organize code into reusable functions
- Separate application logic from data storage
- Implement rule-based decision making
- Handle different user inputs effectively
- Store application data using file handling
- Manage software projects using Git and GitHub
- Write professional technical documentation
Internship: CodeAlpha Python Programming Internship
Task: Task 4 – Basic Chatbot
Domain: Python Programming
Possible future enhancements include:
- Natural Language Processing (NLP) integration
- Machine Learning-based responses
- Voice input and speech output
- Graphical User Interface (GUI)
- Web-based chatbot using Flask
- Database storage for conversations
- Sentiment analysis
- Larger knowledge base
Helina Leul
GitHub:
https://github.com/Helina-Leul
This project is licensed under the MIT License.
See the LICENSE file for more information.
If you found this project useful or interesting, consider giving it a ⭐ on GitHub.
Thank you for visiting this repository!


