Unit 4 Task 9: Small factorial

Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.

Unit 4 Task 9 - Small factorial

← Unit 4 tasks · Solution


Write factorial(n) that returns the product 1 × 2 × … × n for an integer n between 1 and 10 inclusive. Use a loop. Do not use math.factorial.

Skills: return, for loop, running product.