human
Left Rotation and Right Rotation of a String | In - place rotates s towards left by d.
In - place rotates s towards right by d.
Driver code"
How can the above be solved in Python?

Can you provide a code to left Rotation and Right Rotation of a String and the other steps required?
assistant
#Here is code to left Rotation and Right Rotation of a String and the other steps required.
 def leftrotate ( s , d ) :
	tmp = s [ d : ] + s [ 0 : d ]
	return tmp
def rightrotate ( s , d ) :
	return leftrotate ( s , len ( s ) - d )
if __name__ == " _ _ main _ _ " :
	str1 = " GeeksforGeeks "
	print ( leftrotate ( str1 , 2 ) )
	str2 = " GeeksforGeeks "
	print ( rightrotate ( str2 , 2 ) )