AI Agents by HandAll problemsAbout

All problems › Python drill · easy · ~4 min

d15 · Split paragraphs

chunking parsing retrieval

Solve it in your browser →

d15 · Split paragraphs (~4 min)

Chunking text. Edit drills.py. Standard library only; no model calls, no API key.

def split_paragraphs(text):

Split a knowledge-base article into paragraphs.

Paragraphs are separated by one or more blank lines; a blank line may hold spaces or tabs, and line endings may be "\n" or "\r\n". Single newlines stay inside a paragraph. Strip each paragraph and drop empty ones. "" or all-whitespace -> [].

Failure messages are enough to go on, so leave the tests unread until you submit.

Starter code and hidden tests open in the editor. Nothing to install.