0% found this document useful (0 votes)
4 views5 pages

Rohit's Python Chatbot Project

Uploaded by

akash.7535485
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

Rohit's Python Chatbot Project

Uploaded by

akash.7535485
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CS Summer Holiday Project

Build Your Own Chatbot Using Python

Student Name: Rohit

Class: 12

School: SMSE

Date: 24 May 2025

Introduction

This project demonstrates a simple rule-based chatbot created using Python.

It is designed to respond to common user queries based on pre-defined conditions.

The chatbot showcases the use of conditionals, loops, and basic string operations.

Python Code

print("Welcome to SimpleChatBot!")

print("Type 'exit' to end the conversation.\n")

while True:

user_input = input("You: ")

user_input = user_input.lower()

if user_input == "hello" or user_input == "hi":

print("ChatBot: Hello! How can I help you?")

elif user_input == "what is your name":

print("ChatBot: I am SimpleChatBot, your Python assistant.")

elif user_input == "how are you":

print("ChatBot: I am just a program, but I'm working fine!")

Page 1
elif user_input == "what is python":

print("ChatBot: Python is a popular programming language.")

elif user_input == "who made you":

print("ChatBot: I was made by a student using Python.")

elif user_input == "tell me a joke":

print("ChatBot: Why don't programmers like nature? It has too many bugs!")

elif user_input == "bye" or user_input == "exit":

print("ChatBot: Goodbye! Have a nice day.")

break

else:

print("ChatBot: Sorry, I did not understand that. Try asking: 'hello', 'how are you'.")

Page 2
Chatbot Screenshot

Page 3
Chatbot Usage Chart

Page 4
Reflections

Through this project, I learned how to build a simple chatbot using Python.

I practiced using if-elif conditions, while loops, and string functions.

One of the challenges was making the chatbot understand different types of input.

In the future, I want to make it smarter by adding keyword detection or using AI.

Page 5

Common questions

Powered by AI

The project reflections mention adding keyword detection and possibly using AI as potential improvements. These enhancements could allow the chatbot to understand a wider range of vocabulary and context, significantly increasing its flexibility and effectiveness in user interactions .

Including a screenshot and usage chart highlights the importance of visual documentation in software projects. It helps illustrate the program's interface and user interaction patterns, providing a clearer understanding of its functionality and performance .

In its current form, SimpleChatBot's limitations include a strict dependency on predefined input phrases, inability to learn from interactions, and lack of context understanding. These limitations can lead to a frustrating user experience as the chatbot may frequently fail to provide relevant responses to varied user inputs .

The SimpleChatBot handles unrecognized user input by using an else clause that outputs a generic response indicating it did not understand. This programming structure shows the chatbot is rule-based, reliant on specific input-output mappings, and lacks natural language understanding .

The primary challenge was making the chatbot understand diverse user inputs. To overcome this, the project reflections suggest incorporating keyword detection or AI to increase understanding and interaction capability, indicating a move towards more sophisticated natural language processing techniques .

The learning outcomes include acquiring skills to build a simple chatbot using Python, understanding conditional logic, loops, and string functions. These contribute to the developer's foundational understanding of programming and preparing for more complex implementations in future projects .

The key programming concepts applied in building the SimpleChatBot include using conditionals (if-elif conditions), loops (while loop), and basic string operations. These concepts enable the chatbot to respond to user queries based on pre-defined conditions .

The SimpleChatBot exemplifies rule-based chatbot principles by using a fixed set of input-output rules to generate responses. This approach allows for straightforward implementation and predictability, but it also restricts the chatbot's adaptability and scalability, limiting interaction depth and user engagement .

The communication flow in SimpleChatBot begins with a user input, which is processed into lowercase for uniformity. The chatbot then evaluates the input against a series of predefined 'if-elif' conditions to determine the appropriate response. If no condition matches, a default fallback response is provided. This decision tree allows for simple yet logical chatbot interactions .

The use of loops, specifically a 'while True' loop, allows the SimpleChatBot to continuously accept and process user input until a specific terminating condition ('exit' or 'bye') is met. This provides a persistent conversational interface where users can interact without repeatedly restarting the program .

You might also like