home/coding/task-028-prompt

Task 028 Prompt

GPTClaudeDeepSeek··1,211 copies·updated 2026-07-14
task-028-prompt.prompt
To compute the factorial of a number n, think step by step:
Start from 1, then multiply it by each integer from 1 up to n.
Now write a Python function factorial_iter(n) that returns the factorial of n using an iterative approach.

when to use it

Community prompt sourced from the open-source GitHub repo KCyrusNF/Prompting-Strategies-CodeGen-Study (MIT). A "Task 028 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

KCyrusNF/Prompting-Strategies-CodeGen-Study · MIT