Out Put Code
Out Put Code
class SimpleChatbot:
def __init__(self):
self.responses = [
"Hello! How can I assist you today?",
"I'm here to chat! What's on your mind?",
"How are you doing today?",
"Tell me more about that!",
"That's interesting! Can you elaborate?",
"I'm not sure I understand. Can you explain?",
"What else would you like to talk about?"
]
def get_response(self):
return random.choice(self.responses)
def chat():
bot = SimpleChatbot()
print("Chatbot: Hi! I'm your chatbot. Type 'exit' to end the chat.")
while True:
user_input = input("You: ")
if user_input.lower() == 'exit':
print("Chatbot: Goodbye!")
break
response = bot.get_response()
print(f"Chatbot: {response}")
if __name__ == "__main__":
chat()