--- a/app.py +++ b/app.py @@ -1,2 +1,4 @@ def page_count(total, size): - return total // size + 1 + if size <= 0: + raise ValueError('invalid size') + return (total + size - 1) // size