human
Dice Throw | DP | The main function that returns number of ways to get sum ' x ' with ' n ' dice and ' m ' with m faces ..
Create a table to store results of subproblems . One extra row and column are used for simpilicity ( Number of dice is directly used as row index and sum is directly used as column index ) . The entries in 0 th row and 0 th column are never used ..
Table entries for only one dice.
Fill rest of the entries in table using recursive relation i : number of dice , j : sum.
Return value.
Driver code"
How can the above be solved in Python?

Give me a code to dice Throw and the other steps required?
assistant
#Here is code to dice Throw and the other steps required.
 def findWays ( m , n , x ) :
	table = [ [ 0 ] * ( x + 1 ) for i in range ( n + 1 ) ]
	for j in range ( 1 , min ( m + 1 , x + 1 ) ) :
		table [ 1 ] [ j ] = 1
	for i in range ( 2 , n + 1 ) :
		for j in range ( 1 , x + 1 ) :
			for k in range ( 1 , min ( m + 1 , j ) ) :
				table [ i ] [ j ] += table [ i - 1 ] [ j - k ]
	return table [ - 1 ] [ - 1 ]
print ( findWays ( 4 , 2 , 1 ) )
print ( findWays ( 2 , 2 , 3 ) )
print ( findWays ( 6 , 3 , 8 ) )
print ( findWays ( 4 , 2 , 5 ) )
print ( findWays ( 4 , 3 , 5 ) )