subject : For a given sequence of characters S, Please move it left K Sequence output after bit . for example , Character sequence S=”abcXYZdef”, Require output cycle to move left 3 Result after bit , namely “XYZdefabc”.
Code :
class Solution:
def func(self , s,num):
left = s[:num]
right = s[num:]
return right + left
a = 'abcdefg'
n = 3
s = Solution()
print(s.func(a,n))