DEV Community

Vaibhav
Vaibhav

Posted on Edited on

Prompt Engineering for Beginners: How to Get Better Results from ChatGPT

I Tried Writing Better Prompts for ChatGPT. Here's What I Learned

I've been exploring AI tools recently, especially ChatGPT. At first, I used it just like a search engine. I'd type a question, get an answer, and move on.

But sometimes the answers weren't what I expected. They were too general, too long, or simply not useful for what I wanted.

Then I started experimenting with the way I wrote my questions.

That's when I became interested in something called prompt engineering.

So, what is prompt engineering?

In simple words, it's the way we give instructions to an AI tool.

Think about asking a person for help. If you only say, "Help me with Python," they won't know exactly what you need.

But if you say, "I'm a beginner learning Python. Can you explain dictionaries with a simple example?", they'll understand your problem much better.

ChatGPT works in a similar way. The clearer your instructions, the more useful the response can be.

A small example

Let's say I want ChatGPT to write an email.

My first prompt might be:

Write an email to a client.

That's not very specific. I haven't explained the situation, the tone, or what the email should include.

A better version would be:

Act as a professional communication assistant. Write a polite email to a client explaining that a project will be delayed by two days. Keep it simple and professional, explain the reason clearly, and suggest a new delivery date.

The second prompt gives ChatGPT more direction.

Five things I try to include in a prompt

I'm still learning, but these five things have helped me write clearer instructions.

1. Role

Tell ChatGPT what kind of help you need.

Example: "Act as a Python tutor."

2. Context

Explain your situation.

Example: "I'm new to Python and understand loops and lists, but dictionaries are confusing me."

3. Task

Say exactly what you want.

Example: "Explain dictionaries with a simple example."

4. Format

Tell it how you want the answer.

Example: "Use short explanations and code examples."

5. Limits

Mention what to avoid or how detailed the answer should be.

Example: "Keep it beginner-friendly and give me five practice questions without showing the answers."

Three prompts you can try yourself

Here are a few examples I found useful while exploring AI tools.

Learning Python

"Act as my Python tutor. Explain dictionaries like I'm a complete beginner. Give me simple examples and then five exercises. Let me try before showing the solutions."

Researching a business idea

"Help me research the audience for a small online clothing business. Organize the answer into customer types, their needs, competitors, and possible marketing ideas. Tell me which points are assumptions."

Creating social media posts

"Give me five Instagram caption ideas for a page that shares beginner-friendly AI tips. Keep them short, natural, and easy to understand."

Mistakes I noticed while using ChatGPT

A few habits can make the results less useful:

  • Asking very broad questions without explaining what I need.
  • Forgetting to mention that I'm a beginner.
  • Putting several unrelated tasks into one prompt.
  • Not telling ChatGPT what format I want.
  • Accepting every answer without checking whether it's correct.

One thing I've learned is that ChatGPT can be helpful, but it isn't always right. It's still important to check the information, especially when learning programming or researching something important.

What I'm learning next

I'm currently learning Python and exploring artificial intelligence tools. I want to understand how these tools work and how people use them in real projects.

I'm not an expert in prompt engineering. I'm just sharing what I've learned so far, I'm not an expert in prompt engineering. I'm just sharing what I've learned so far, and I hope to share more experiments as I continue learning.

If you're also learning to use AI tools, try changing one of your usual prompts and compare the results.

What's one thing you've learned that makes ChatGPT more useful? I'd like to hear your experience.

Top comments (0)