ASCI Logo
ASCI.Academy
LearnPracticeCompeteCareer
Sign InGet Started

Search ASCI Academy

Universal search across Courses, Lessons, Skills, Projects, Challenges, Competitions, Jobs, Internships, and Users

anthropic claude-prompt-engineering

Curriculum Index

Current LevelInitiate
0/ 500 XP
Gravit Certificate:
100% Required
  • 1.1 XML Tag Separation & Prompt Formatting
•
1
2
3
4
5
6
7
8
9
10
Module 1: Structural XML Tagging & Prompt Architecture•Lesson 1

1.1 XML Tag Separation & Prompt Formatting

### Anthropic Structural XML Guidelines
Anthropic models excel when instructions, reference context, and user inputs are strictly separated by XML tags.

example.pyPython 3.11
def format_claude_prompt(instruction, context, user_query):
return (
f"{instruction}\n"
f"{context}\n"
f"{user_query}"
)
Python 3.11
•
Interactive Challenge
+50 XP
Challenge Objective

Build the structural XML prompt for Claude and print the formatted prompt.

solution.py
UTF-84 SpacesAuto-saved
cpython3.11:~/workspace
CPython 3.11.8 (WASM)
$python3 -u solution.py
Click "Compile & Run" (or press Ctrl + Enter) to compile AST, verify bytecode, and execute the solution.