A simple rule-based chatbot developed as part of the CodeAlpha Python Programming Internship (Task 4: Basic Chatbot).
Deedee responds to everyday conversational inputs β greetings, mood check-ins, jokes, laughter, and more β using keyword-based pattern matching. It also remembers the user's name for the duration of the chat and can save the full conversation transcript to a file.
- π Responds to greetings (hello, good morning, good night, etc.)
- π Understands mood-related messages (happy, sad, tired, bored)
- π Detects laughter (haha, lol, lmao, emojis) and reacts accordingly
- π Remembers the user's name during the conversation (e.g. "my name is Sara")
- π Tells the current time and date
- π Tells jokes on request
- π¨ Answers simple fun questions (favorite color, favorite food, age)
- π Multiple randomized replies per topic, so conversations feel less repetitive
- π Saves the full chat transcript to a
.txtfile at the end (optional) - π¨ Optional colored terminal interface (works without Colorama as well)
- Python 3
randommodule (for varied responses)datetimemodule (for time/date replies)- Colorama (Optional)
CodeAlpha_Chatbot/
βββ chatbot.py
βββ README.md
Chat transcripts (e.g.
chat_transcript_*.txt) are generated automatically if you choose to save them, and are not part of the repository.
- Make sure Python 3 is installed.
- Download or clone this repository.
- Open the project folder in your terminal.
- Run the following command:
python chatbot.py- Start chatting! Try saying things like:
hellomy name is Sarahow are youjokehaha that's funnybye(to end the chat)
Optional: Install Colorama for a colored terminal interface.
pip install coloramaThe application also works correctly without Colorama (plain text mode).
This project demonstrates the use of:
- Conditional Statements (if-elif logic via rule matching)
- Functions and Modular Programming
- Loops (continuous chat loop)
- Lists, Tuples, and Dictionaries
- Basic String Processing and Pattern Matching
- File Handling (saving chat transcripts)
- User Input Validation
Saleha Shahid BS Electrical Engineering University of Management and Technology (UMT)
CodeAlpha β Python Programming Internship