Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. def rotate(input,d):
  2.  
  3. # slice string in two parts for left and right
  4. l1 = input[0 : leftShifts]
  5. l2 = input[leftShifts :]
  6. input = l2 + l1
  7. r1 = input[0 : len(input)-rightShifts]
  8. r2 = input[len(input)-rightShifts : ]
  9. return r2 + r1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement