human
Number of triangles after N moves | function to calculate number of triangles in Nth step.
Driver code"
How can the above be solved in Python?
 ... Give me a code to number of triangles after N moves and the other steps required?
assistant
#Here is code to number of triangles after N moves and the other steps required.
 def numberOfTriangles ( n ) :
	ans = 2 * ( pow ( 3 , n ) ) - 1 ;
	return ans ;
n = 2
print ( numberOfTriangles ( n ) )