Challenge: Square the Factorials
Square the factorials.
We'll cover the following
Problem statement
In this challenge, you need to square the factorials of the first n
numbers. Implement the function square_factorial
that takes n
as a parameter. Write a one-line implementation of this function using an anonymous function. To facilitate single-line implementation, you have to define another function factorial
that computes the factorial of an integer.
💡 Note: There’s a hint for you, check it out.
Input
An integer
Output
A list
Sample input
5
Sample output
[1, 1, 4, 36, 576]
Try to implement the function below. Do not forget to use the concepts taught in the previous lessons. Feel free to view the solution, after giving it a few shots. Good luck!
Get hands-on with 1400+ tech skills courses.