human
Undulating numbers | Python3 program to check whether a number is undulating or not.
Considering the definition with restriction that there should be at least 3 digits.
Check if all alternate digits are same or not ..
Driver Code"
Solution in Python:
assistant
#Here is code to undulating numbers and the other steps required.
 def isUndulating ( n ) :
	if ( len ( n ) <= 2 ) :
		return False
	for i in range ( 2 , len ( n ) ) :
		if ( n [ i - 2 ] != n [ i ] ) :
			return False
	return True
n = "1212121"
if ( isUndulating ( n ) ) :
	print ( " Yes " )
else :
	print ( " No " )