Beginner-Friendly Topic
Take your time - it's perfectly normal to re-read this topic 2-3 times. Try the interactive code editor below to run code yourself. Use the Q&A section to check your understanding before moving on.You've got this!
Lesson 12 of 13
Module 3 Practice
Build a practical prompt library with reusable prompts for common tasks.
Mini Project: Build a Prompt Library
Mini Project: Build a Prompt Library
# Mini Project: Build your own reusable prompt library
prompt_library = {
"learning": {
"description": "Explain a concept for a beginner",
"template": """I am learning about [TOPIC] and I am a complete beginner.
Explain [SPECIFIC CONCEPT] using:
1. A simple one-sentence definition
2. An everyday analogy
3. One practical example
Keep the total explanation under 150 words.""",
"example_use": "Replace [TOPIC] with 'Python programming' and [SPECIFIC CONCEPT] with 'functions'"
},
"writing": {
"description": "Improve a piece of writing",
"template": """Improve the following text.
Target audience: [AUDIENCE]
Desired tone: [TONE - formal/casual/professional]
Goal: Make it clearer and more compelling without changing the core message.
Keep the improved version under [LENGTH] words.
Original text:
[PASTE YOUR TEXT HERE]""",
"example_use": "Use for emails, reports, or social media posts"
},
"summarizing": {
"description": "Summarize any document",
"template": """Summarize the following text.
Format: [BULLET POINTS / PARAGRAPH / TABLE]
Length: Maximum [NUMBER] sentences or bullet points
Focus on: The main points, key decisions, and action items (if any).
Text to summarize:
[PASTE TEXT HERE]""",
"example_use": "Use for long articles, meeting notes, or reports"
},
"brainstorming": {
"description": "Generate ideas",
"template": """Generate [NUMBER] creative ideas for [TOPIC].
Context: [Brief description of your situation or constraints]
Requirements: Each idea should be [REQUIREMENT - practical/low-cost/suitable for beginners]
Format: Numbered list with a one-sentence explanation for each idea.""",
"example_use": "Use for content ideas, business ideas, or problem-solving"
},
"coding": {
"description": "Get coding help",
"template": """I am writing a [LANGUAGE] program that [WHAT IT DOES].
The current issue is: [DESCRIBE THE PROBLEM]
Here is the relevant code:
[PASTE CODE HERE]
Please: [FIX THE BUG / EXPLAIN HOW IT WORKS / SUGGEST AN IMPROVEMENT]
Explain your answer step by step.""",
"example_use": "Use for debugging, code review, or learning"
},
}
print("=== Your Prompt Library ===")
print()
for category, prompt_data in prompt_library.items():
print(f"Category: {category.upper()}")
print(f"Purpose: {prompt_data['description']}")
print(f"Template: {prompt_data['template'][:100]}...")
print(f"Example use: {prompt_data['example_use']}")
print()
print(f"Total prompts in library: {len(prompt_library)}")
print("Fill in the [BRACKETS] with your specific details when you use each prompt.")Diagram
Loading diagram…
Practice Diagram
Try It Yourself
Try It YourselfHTML
HTML Editor
✓ ValidTab = 2 spaces
HTML|20 lines|710 chars|✓ Valid syntax
UTF-8
Key Takeaways from Module 3
- A prompt is the instruction you give to a Generative AI model - its quality determines the output quality
- Good prompts include four components: context, instruction, example (optional), and output format
- Be specific: who is the audience, what format, what length, and what tone
- Few-shot prompting (including examples) significantly improves output consistency
- Role prompting helps the AI apply the right knowledge and tone for your situation
- Getting a great response is usually an iterative process: submit, review, refine, repeat
- Never include sensitive or confidential information in AI prompts
Key Takeaways
- Build a practical prompt library with reusable prompts for common tasks.
- A prompt is the instruction you give to a Generative AI model - its quality determines the output quality
- Good prompts include four components: context, instruction, example (optional), and output format
- Be specific: who is the audience, what format, what length, and what tone
Finished this lesson?
0 of 13 in Module 3