diff --git a/src/codewars/kata_pagination_helper.py b/src/codewars/kata_pagination_helper.py index 7a6c3fc..3be65a3 100644 --- a/src/codewars/kata_pagination_helper.py +++ b/src/codewars/kata_pagination_helper.py @@ -28,9 +28,11 @@ class PaginationHelper: if page_index == 0: return len(self.collection[: self.items_per_page]) - return self.collection[ - self.items_per_page * page_index : self.items_per_page * page_index * 2 - ] + return len( + self.collection[ + self.items_per_page * page_index : self.items_per_page * page_index * 2 + ] + ) # determines what page an item at the given index is on. Zero based indexes. # this method should return -1 for item_index values that are out of range @@ -38,8 +40,8 @@ class PaginationHelper: pass -collection = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] +collection = ["a", "b", "c", "d", "e", "f"] helper = PaginationHelper(collection, 4) print(helper.page_count()) -print(helper.page_item_count(2)) +print(helper.page_item_count(1))