human
Program to find Nth term of the series 3 , 6 , 18 , 24 , ... | function to calculate Nth term of series.
By using above formula.
get the value of N.
Calculate and print the Nth term"
How can the above be solved in Python?
assistant
#Here is code to program to find Nth term of the series 3 , 6 , 18 , 24 , .
 def nthTerm ( N ) :
	return ( N * ( ( N // 2 ) + ( ( N % 2 ) * 2 ) + N ) )
if __name__ == ' _ _ main _ _ ' :
	N = 5
	print ( " Nth ▁ term ▁ for ▁ N ▁ = ▁ " , N , " ▁ : ▁ " , nthTerm ( N ) )