Prompting is the art of directing an LLM's attention. Instead of retraining massive models, we can change their behavior completely just by structuring our text prompts.
**System Prompts** (also called system instructions) define the character, boundaries, guidelines, and output format of the AI before any user message is sent. They establish high-level behavioral constraints (e.g., *"You are a helpful chemistry tutor who never gives the answer directly but guides the student step-by-step"*).
LLMs are excellent at learning patterns on the fly. In a standard "Zero-Shot" prompt, you ask a question directly. In **Few-Shot Prompting**, you provide 2 to 5 examples of input-output pairs inside the prompt. This teaches the model the exact style, tone, and format you expect.
If you ask an LLM a complex math or logic question directly, it may output a wrong answer because it attempts to predict the final answer immediately. **Chain of Thought** prompting instructs the model to *"think step-by-step"* before outputting the final result. This allows the model to compute intermediate reasoning steps, drastically increasing accuracy.
Let's simulate a few-shot sentiment analyzer using standard string formatting in Python!
few_shot_prompt.Input: "Great service!" -> Output: POSITIVE).Input: "The battery died in 10 minutes." -> Output: and print the prompt.Verify your structured template in the execution console on the right!