Write a lambda function called factorials_1_to_n that computes the factorials of the numbers from 1 to n. Hint: Use the function factorial you already created.
The only thing I can think of doing is writing a for loop within the lambda function like.... for i in range(1,len(n)+1): factorial(i)…. but for loops are not allowed within a lambda function.
def factorial(n):
product=n
while n!=1:
product=product*(n-1)
n=n-1
return(product)
y=factorial(4)
print(y)
factorials_1_to_n = lambda n: ????????
y=factorials_1_to_n(4)
print(y)