human
Give me a code to tetranacci Numbers and the other steps required given the following:
Tetranacci Numbers | Function to print the N - th tetranacci number.
Initialize first four numbers to base cases.
declare a current variable.
Loop to add previous four numbers for each number starting from 4 and then assign first , second , third to second , third , fourth and curr to fourth respectively.
Driver code"
Solution in Python:
assistant
#Here is code to tetranacci Numbers and the other steps required.
 def printTetra ( n ) :
	if ( n < 0 ) :
		return ;
	first = 0 ;
	second = 1 ;
	third = 1 ;
	fourth = 2 ;
	curr = 0 ;
	if ( n == 0 ) :
		print ( first ) ;
	elif ( n == 1 or n == 2 ) :
		print ( second ) ;
	elif ( n == 3 ) :
		print ( fourth ) ;
	else :
		for i in range ( 4 , n + 1 ) :
			curr = first + second + third + fourth ;
			first = second ;
			second = third ;
			third = fourth ;
			fourth = curr ;
	print ( curr ) ;
n = 10 ;
printTetra ( n ) ;