Prompt Engineering — Talking to AI Effectively
Learn how to write better prompts to get more useful and accurate responses from AI assistants like ChatGPT.
Why Your Prompts Matter
Tips for Better Prompts
Prompt Examples: From Weak to Strong
WEAK: Write a story.
STRONG: Write a short adventure story (about 200 words) for a 10-year-old, featuring a girl named Maya who discovers a secret coding lab inside her school. Make it exciting and end with a cliffhanger.
WEAK: Explain Python.
STRONG: Explain what Python is and why it is a great first programming language. Use simple analogies a beginner would understand, and give 3 examples of cool things you can build with Python.
WEAK: Fix my code.
STRONG: My Python code below should print even numbers from 1 to 20 but it prints nothing. Find the bug and explain what went wrong:
for i in range(1, 20):
if i % 2 == 1:
print(i)If you do not get a great answer on the first try, do not give up! Refine your prompt. You can say things like 'Make it simpler,' 'Give me a specific example,' or 'Explain it like I am 10 years old.' Prompt engineering is an iterative process — each attempt teaches you what works better.
Take these weak prompts and rewrite them to be strong prompts: 1) 'Tell me about coding.' 2) 'Write a program.' 3) 'What is the internet?' For each one, add specifics: Who is the audience? What format do you want? How long should it be? What details matter? Then test your improved prompts on an AI and compare the results to the weak versions!
Ready to build?
Put what you learned into practice — pick a project and start coding.
Start Building Free