Python | sympy.bell() method Last Updated : 14 Jul, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report With the help of sympy.bell() method, we can find Bell number and Bell polynomials in SymPy. bell(n) - Syntax: bell(n) Parameter: n - It denotes the order of the bell number. Returns: Returns the nth bell number. Example #1: Python3 # import sympy from sympy import * n = 5 print("Value of n = {}".format(n)) # Use sympy.bell() method nth_bell = bell(n) print("Value of nth bell number : {}".format(nth_bell)) Output: Value of n = 5 Value of nth bell number : 52 bell(n, k) - Syntax: bell(n, k) Parameter: n - It denotes the order of the bell polynomial. k - It denotes the variable in the bell polynomial. Returns: Returns the expression of the bell polynomial or its value. Example #2: Python3 # import sympy from sympy import * n = 5 k = symbols('x') print("Value of n = {} and k = {}".format(n, k)) # Use sympy.bell() method nth_bell_poly = bell(n, k) print("The nth bell polynomial : {}".format(nth_bell_poly)) Output: Value of n = 5 and k = x The nth bell polynomial : x**5 + 10*x**4 + 25*x**3 + 15*x**2 + x Example #3: Python3 # import sympy from sympy import * n = 5 k = 3 print("Value of n = {} and k = {}".format(n, k)) # Use sympy.bell() method nth_bell_poly = bell(n, k) print("The nth bell polynomial value : {}".format(nth_bell_poly)) Output: Value of n = 5 and k = 3 The nth bell polynomial value : 1866 bell(n, k, (x1, x2, x3, ...)) - Syntax: bell(n, k, (x1, x2, x3, ...)) Parameter: n - It denotes the order of the bell polynomial of second kind. k - It is a parameter in the bell polynomial of second kind. (x1, x2, x3, ...) - It denotes the tuple of variable symbols. Returns: Returns the Bell polynomials of the second kind. Example #4: Python3 # import sympy from sympy import * n = 5 k = 3 variables = symbols('x:6')[1:] print("Value of n = {}, k = {} and variables = {}".format(n, k, variables)) # Use sympy.bell() method nth_bell_poly = bell(n, k, variables) print("The nth bell polynomial of second kind : {}".format(nth_bell_poly)) Output: Value of n = 5, k = 3 and variables = (x1, x2, x3, x4, x5) The nth bell polynomial of second kind : 10*x1**2*x3 + 15*x1*x2**2 Comment More infoAdvertise with us Next Article Python | sympy.bernoulli() method R rupesh_rao Follow Improve Article Tags : Python SymPy Practice Tags : python Similar Reads Python | sympy.bernoulli() method With the help of sympy.bernoulli() method, we can find the Bernoulli number and Bernoulli polynomial in SymPy. bernoulli(n) - Syntax: bernoulli(n) Parameter: n - It denotes the nth bernoulli number. Returns: Returns the nth bernoulli number. Example #1: Python3 # import sympy from sympy import * n = 2 min read Python | sympy.Add() method With the help of sympy.Add() method, we can add the two variables and can form a mathematical expression by using sympy.Add() method. Syntax : sympy.Add() Return : Return the addition of two variables. Example #1 : In this example we can see that by using sympy.Add() method, we are able to add the n 1 min read Python | sympy.Add() method With the help of sympy.Add() method, we can add two variables and can form a mathematical expression by using sympy.Add() method. Syntax : sympy.Add() Return : Return the addition of two variables. Example #1 : In this example we can see that by using sympy.Add() method, we are able to add the two v 1 min read Python | sympy.Lambda() method With the help of sympy.Lambda() method, we can perform any mathematical operation by just defining the formula and then pass the parameters with reference variable by using sympy.Lambda(). Syntax : sympy.Lambda() Return : Return the result of mathematical formula. Example #1 : In this example we can 1 min read Python | Sympy Circle() method In Simpy, the function Circle() is used to make circle from a center and a radius, from three non-collinear points, or the equation of a circle. Syntax: Circle() Parameters: center : Point and radius : number or sympy expression or points : sequence of three Points or equation : equation of a circle 1 min read Python | sympy.S() method With the help of sympy.S() method, we can make a single instance of an object by using sympy.S() method, where S denotes to singleton class. Syntax : sympy.S() Return : Return the single instance of an object. Example #1 : In this example we can see that by using sympy.S() method, we are able to cre 1 min read Like