human
Maximum value possible by rotating digits of a given number | Function to find the maximum value possible by rotations of digits of N.
Store the required result.
Store the number of digits.
Iterate over the range [ 1 , len - 1 ].
Store the unit 's digit.
Store the remaining number.
Find the next rotation.
If the current rotation is greater than the overall answer , then update answer.
Print the result.
Driver Code"
How can the above be solved in Python?
 ... Write me a code to maximum value possible by rotating digits of a given number and the other steps required?
assistant
#Here is code to maximum value possible by rotating digits of a given number and the other steps required.
 def findLargestRotation ( num ) :
	ans = num
	length = len ( str ( num ) )
	x = 10 ** ( length - 1 )
	for i in range ( 1 , length ) :
		lastDigit = num % 10
		num = num // 10
		num += ( lastDigit * x )
		if ( num > ans ) :
			ans = num
	print ( ans )
N = 657
findLargestRotation ( N )