Bird
0
0

You want the AI to create a dictionary where keys are numbers 1 to 3 and values are their squares, but only for even numbers. Which prompt best achieves this?

hard🚀 Application Q8 of 15
AI for Everyone - Prompting Basics
You want the AI to create a dictionary where keys are numbers 1 to 3 and values are their squares, but only for even numbers. Which prompt best achieves this?
A"Create a dictionary with keys 1 to 3 and values as squares, include only even keys"
B"List numbers 1 to 3"
C"Create a list of squares for numbers 1 to 3"
D"Show me all odd numbers from 1 to 3"
Step-by-Step Solution
Solution:
  1. Step 1: Understand the desired output

    The user wants a dictionary with keys 1 to 3, values as squares, but only even keys included (2).
  2. Step 2: Match prompt to output

    Only "Create a dictionary with keys 1 to 3 and values as squares, include only even keys" clearly instructs to create such a dictionary with the condition on even keys.
  3. Final Answer:

    "Create a dictionary with keys 1 to 3 and values as squares, include only even keys" -> Option A
  4. Quick Check:

    Prompt specifies dictionary + condition = "Create a dictionary with keys 1 to 3 and values as squares, include only even keys" [OK]
Quick Trick: Include conditions clearly in prompts for precise output [OK]
Common Mistakes:
MISTAKES
  • Choosing list instead of dictionary
  • Ignoring condition on keys
  • Asking for unrelated data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AI for Everyone Quizzes