BestPromptFinder
HomeCoding › Below is an instruction that describes a task. Write a respo...

Below is an instruction that describes a task. Write a respo...

Coding · Gemini, GPT-5.6, Claude · Coding
52Quality
88%Useful
85Reliability

The prompt

Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: Create an AI-based chatbot in Python that can answer simple queries about a product or service. ### Input: Not applicable ### Output: import random # The answers to the queries answers = { 'What is XYZ?': 'XYZ is a company that provides XYZ services.', 'What does XYZ do?': 'XYZ helps customers find solutions to their problems.', 'Where is XYZ located?': 'XYZ is located in ABC city.', 'What are the benefits of using XYZ?': 'XYZ provides a quick and easy way to find solutions to your problems.' } # Generate a response def generate_response(question): if question in answers: return answers[question] else: return random.choice(['I am not sure I understand.', 'Can you give me more information?', 'Can I help you with something else?']) # Start the conversation question = input('Welcome to XYZ. How can I help you? ') response = generate_response(question) while response != 'Goodbye': print(response) question = input('Is there anything else I can help you with? ') response = generate_response(question) print('Goodbye!')
Find similar in the app →

Why this prompt

Source

Hugging Face

Related Coding prompts

PRD to MVP Technical Plan
Quality 93 · Claude Code
Full-Stack CRUD App Builder
Quality 93 · Claude Code
Legacy Refactor Planner
Quality 93 · Claude Code
Test Suite Generator
Quality 93 · Claude Code
Third-Party API Integration
Quality 93 · Claude Code
Database Schema and Migration
Quality 93 · Claude Code