You can use a loop that takes a new number after each calculation. Alternatively, you can create a list of numbers and use the loop function to calculate the factorial of each number in the list.