Write pseudo code to compute the factorial of a number (iterative preferred over recursion). Asked in the HackerRank online assessment stage. This was an entry-level SE assessment; content varies by department.
Implement factorial(n), accepting a non-negative integer n and returning n!, the product of every integer from 1 through n. By definition, 0! = 1.
nn!def factorial(n):