Skip to main content

Practice ยท 2 of 2

Pagination Loop

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.

Difficulty: intermediate

Back to lesson: Practice: Client Behavior Drills