Pagination Links with Ellipses

easy
Unit 11 · Stdlib0/3 to milestone

Implement page_links(current, total, window=1) returning the list of items to show in a pagination bar: page numbers (ints) and "…" for gaps.

Always show the first and last page, and pages within window of the current page. Replace any gap of two or more hidden pages with "…"; if only one page would be hidden, show it instead.

#ui-logic#lists2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Pagination Links with Ellipses · TechGradify