Skip to main content

Practice · 2 of 2

Pagination Loop

CHALLENGE
Difficulty: intermediate+25 XP

Implement collect(fetch) where fetch(page) returns {'items': [...], 'has_more': bool}. Loop pages from 1, extending items, stopping when has_more is False or page exceeds 1000 (safety bound). Return the concatenated list.

Back to lesson: Practice: Client Behavior Drills