home/coding/prompt-67

Prompt

GPTClaudeDeepSeek··1,254 copies·updated 2026-07-14
prompt-67.prompt
Write a Python function `flatten(nested)` that returns a single flat list containing every
non-list element of `nested`, in left-to-right order, however deeply the lists are nested.

Treat lists and tuples as nestable; everything else (ints, strings, etc.) is a leaf — do not
iterate into strings. Example: `flatten([1, [2, (3, 4)], [[5]]])` → `[1, 2, 3, 4, 5]`.

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

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