human
Repdigit Numbers | Function to check if a number is a Repdigit number.
To store previous digit ( Assigning initial value which is less than any digit ).
Traverse all digits from right to left and check if any digit is smaller than previous ..
Driver code"
How can the above be solved in Python?
assistant
#Here is code to repdigit Numbers and the other steps required.
 def isRepdigit ( num , b ) :
	prev = - 1
	while ( num ) :
		digit = num % b
		num //= b
		if ( prev != - 1 and digit != prev ) :
			return False
		prev = digit
	return True
num = 2000
base = 7
if ( isRepdigit ( num , base ) ) :
	print ( " Yes " )
else :
	print ( " No " )