Python | sympy.primorial() method
With the help of sympy.primorial() method, we can find the product of the first n primes (default) or the primes less than or equal to n (when nth=False), where n and nth are parameters to the method.
Syntax: primorial(n, nth)
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
n – It denotes the number for which the product of first n primes or prime less than or equal to n is calculated.
nth – It denotes a boolean value. When True, it returns the product of first n primes whereas when False returns the product of primes less than or equal to n.
Returns: Returns the product of the first n primes or the primes less than or equal to n .
The product of first 3 primes is 30
The product of primes less than or equal to 10 is 210