Skip to content

Simple chatbot using Python dictionaries def simple_chatbot(user_input): responses = { "hi": "Hello! How can I help you?", "what's your name?": "I'm SimpleBot, your virtual assistant!", "how are you?": "I'm just a program, but I'm here to help you!", "bye": "Goodbye! Have a great day!", } # Convert user input to lowercase for matching user_input = user_input.lower() # Return response or default message return responses.get(user_input, "I'm not sure how to respond to that.") # Start the chat print("SimpleBot: Hello! Ask me anything (type 'bye' to quit)") while True: user_input = input("You: ") if user_input.lower() == "bye": print("SimpleBot: Goodbye!") break response = simple_chatbot(user_input) print(f"SimpleBot: {response}") #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Keerthu262 opened this issue Mar 8, 2025 · 0 comments

Comments

@Keerthu262
Copy link

No description provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant