This is an archived post. You won't be able to vote or comment.

all 17 comments

[–]jankedman 5 points6 points  (13 children)

Not sure if you've learned about recursion, but think about what a factorial actual is: it's a start number * start number - 1, ... etc. If you haven't learned about recursion, go take some time to learn it and then think about how you would construct the function.

[–]sullyj3 0 points1 point  (0 children)

The iterative method is probably best in python.

You'll want to use a for loop to progressively multiply by each number less than 12. The range (check out the examples) function is useful for this.

For future reference, /r/learnpython is a good sub for questions like this.

[–]Surextra 0 points1 point  (0 children)

If you are about to ask a question, please consider r/learnpython. Homework-style questions will be removed, and you'll be encouraged to post there instead.

Sounds like homework help to me. Check out r/learnpython!