home/coding/prompt-72

Prompt

GPTClaudeDeepSeek··1,280 copies·updated 2026-07-14
prompt-72.prompt
Write a Python function `parse_pagination(params)` for an API endpoint. `params` is a dict that
may contain `"page"` and `"page_size"` as strings (e.g. from a query string).

- Default `page` is 1 and default `page_size` is 20 when absent.
- Both must be positive integers (>= 1); reject anything else (non-integer, zero, negative) by
  raising `ValueError`.
- Clamp `page_size` to a maximum of 100.
- Return a dict `{"page": <int>, "page_size": <int>}`.

Put it in a single Python code block. It will be imported as `from solution import parse_pagination`.

fill the variables

This prompt has 1 variable. Pro fills them into a ready-to-paste prompt for you — no manual find-and-replace.

{"page": <int>, "page_size": <int>}
Unlock with Pro →

when to use it

Community prompt sourced from the open-source GitHub repo Green-PT/honey-for-devs (MIT). A "Prompt" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

codingcommunitydeveloper

source

Green-PT/honey-for-devs · MIT