Python | sympy.nT() method
With the help of sympy.nT() method, we can calculate the number of partitions that can have a given number of parts in SymPy.
Syntax: nT(items, k)
items – An integer, a list or a string upon which partitions is to be calculated.
k – An integer specifying the number of parts that the partition should contain.
Returns: Returns the number of partitions that have given number of parts.
Value of k = 2 and the items are = aaa Partitions : 1
Value of k = 3 and the items are = [1, 3, 2, 5, 4] Partitions : 25
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