Skip to content

Fix incorrect factorial multiplication - #2

Open
saritai wants to merge 1 commit into
new2code:mainfrom
saritai:saritai-fix-repo-bug
Open

saritai wants to merge 1 commit into
new2code:mainfrom
saritai:saritai-fix-repo-bug

Conversation

@saritai

@saritai saritai commented Jul 30, 2026 •

Copy link
Copy Markdown

Summary

  • fix factorial loop logic in bugged_factorial_finder.py
  • multiply by the loop index each iteration instead of multiplying by the running factorial again

Result

  • script now returns the correct factorial value for 6 (720)

Use the loop index as the multiplier instead of multiplying by the running factorial again, which caused exponential growth and incorrect results.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant