human
Check if all the digits of the given number are same | Function to check if all the digits in the number N is the same or not.
Find the last digit.
Find the current last digit.
Update the value of N.
If there exists any distinct digit , then return No.
Otherwise , return Yes.
Driver Code"
How can the above be solved in Python?

Give me a code to check if all the digits of the given number are same and the other steps required?
assistant
#Here is code to check if all the digits of the given number are same and the other steps required.
 def checkSameDigits ( N ) :
	digit = N % 10 ;
	while ( N != 0 ) :
		current_digit = N % 10 ;
		N = N // 10 ;
		if ( current_digit != digit ) :
			return " No " ;
	return " Yes " ;
if __name__ == " _ _ main _ _ " :
	N = 222 ;
	print ( checkSameDigits ( N ) ) ;