Lesson 4
Prompt Engineering
How to write instructions that get great answers from AI
1What Is A Prompt?✨
A prompt is like a question or instruction you give to an AI to get the information or response you want. Think of it as a recipe: the better your recipe (prompt), the tastier the dish (response). For example, instead of asking, "Tell me about animals," you might ask, "What are some interesting facts about elephants?"2Basic Prompting🎯
Basic prompting involves asking straightforward questions. A simple question can lead to a simple answer. For example, “What is the capital of France?” is a basic prompt that will get you a direct answer: “Paris.” Start simple and build from there!
3Role Prompting💡
Role prompting means asking the AI to take on a specific role. This can help shape the response. For example, “You are a travel guide. What should I see in Paris?” helps the AI provide answers from a travel perspective.
4Giving Context🚀
Providing context means giving the AI background information to help it understand your question better. For instance, saying, “In a science class, explain photosynthesis to a 10-year-old,” gives the AI a clearer idea of how to respond.
5Setting Constraints🔍
Setting constraints limits the response to fit your needs. For example, “List three fruits that are red” restricts the AI to only three fruits, making the answer concise and focused.
6Few-Shot Prompting⭐
Few-shot prompting involves giving examples to guide the AI’s response. For example, “Here are two examples of healthy snacks: apple slices and carrot sticks. Suggest another healthy snack.” This helps the AI understand the type of response you want.
7Asking For Structured Output🧩
Sometimes, you want answers in a specific format. For instance, you might say, “List three pros and cons of using robots in schools in bullet points.” This way, the AI knows exactly how to structure the answer.
8Chain-Of-Thought At A High Level🎈
Chain-of-thought prompting encourages the AI to explain its reasoning. You could ask, “Why is it important to recycle? Explain your answer step by step.” This leads to a more thoughtful response.
9Improving And Testing A Prompt✨
Improving a prompt is like refining a draft. If the AI's answer isn’t what you expected, tweak your prompt. Ask yourself: Is it clear? Did I provide enough context? Test different prompts to see which works best.
Now it’s your turn! Try creating your own prompt in the Ask AI box on this page and compare the results. Have fun exploring the world of AI!
📝 Knowledge Check
Quick 5-question check on Prompt Engineering. Just for practice!
🎯 Practice Challenges
Master Prompt Engineering by completing all 3 difficulty levels
Prompt Engineering - Easy Challenge
Start with the basics. Perfect for beginners!
Prompt Engineering - Medium Challenge
Get more challenging. Build your confidence!
Prompt Engineering - Hard Challenge
Master this concept. Prove your skills!
🏆 Study a lesson for 2+ minutes to earn +10 TalentJR Points a day. Badges, certificates & prizes →
Ready to Master Prompt Engineering? 🚀
Complete the challenges, take the quiz and keep your learning streak going!
Keep learning
- ← Previous lessonLesson 3: Generative AIHow AI creates text, images, and code - and where it can go wrong
- Next lesson →Lesson 5: AI AgentsAI that can plan, use tools, and complete multi-step tasks on its own
- Grade 12 courseDatabases - Data Management MasterSQL coding course for kids.
- Student ToolsFree calculators for studentsPercentage, fraction, ratio and marks calculators with steps.
- CBSECBSE & NCERT study materialClass-wise Maths, Science and Computer chapters with solutions.
- Future SkillsExplore future skillsAI, robotics and new-age skills explained for students.