human
Count number of ways to divide a number in 4 parts | Returns count of ways.
Generate all possible quadruplet and increment counter when sum of a quadruplet is equal to n.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to count number of ways to divide a number in 4 parts and the other steps required.
 def countWays ( n ) :
	for i in range ( 1 , n ) :
		for j in range ( i , n ) :
			for k in range ( j , n ) :
				for l in range ( k , n ) :
					if ( i + j + k + l == n ) :
						counter += 1
	return counter
if __name__ == " _ _ main _ _ " :
	n = 8
	print ( countWays ( n ) )