human
Count number of unique ways to paint a N x 3 grid | Function to count the number of ways to paint N * 3 grid based on given conditions.
Count of ways to pain a row with same colored ends.
Count of ways to pain a row with different colored ends.
Traverse up to ( N - 1 ) th row.
For same colored ends.
For different colored ends.
Print the total number of ways.
Driver Code.
Function call"
How can the above be solved in Python?

=====
Can you provide a code to count number of unique ways to paint a N x 3 grid and the other steps required?
assistant
#Here is code to count number of unique ways to paint a N x 3 grid and the other steps required.
 def waysToPaint ( n ) :
	same = 6
	diff = 6
	for _ in range ( n - 1 ) :
		sameTmp = 3 * same + 2 * diff
		diffTmp = 2 * same + 2 * diff
		same = sameTmp
		diff = diffTmp
	print ( same + diff )
N = 2
waysToPaint ( N )