# Python | sympy.factorial2() method

With the help of sympy.factorial2() method, we can find the Double factorial. Double factorial of a number is given by –

Syntax: factorial2(n)

Parameter:
n – It denotes the number whose double factorial is to be calculated.

Returns: Returns the double factorial of number, i. e., n.

Example #1:

 # import sympy   from sympy import *     n = 10 print("Value of n = {}".format(n))      # Use sympy.factorial2() method   factorial2_n = factorial2(n)           print("Double factorial of n : {}".format(factorial2_n))

Output:

Value of n = 10
Double factorial of n : 3840


Example #2:

 # import sympy   from sympy import *     n = -3 print("Value of n = {}".format(n))      # Use sympy.factorial2() method   factorial2_n = factorial2(n)           print("Double factorial of n : {}".format(factorial2_n))

Output:

Value of n = -3
Double factorial of n : -1


My Personal Notes arrow_drop_up

Coder Machine Learner Social Activist Vocalist

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.