Task 028 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
more in Coding
Coding✓ tested
Senior code review (strict mode)
senior staff engineer running a merciless but fair review
Coding✓ tested
Debug by hypothesis, not by guessing
debugging partner who forms theories before touching code
Coding✓ tested
Generate tests from described behavior
test engineer who writes tests that would actually catch regressions