You are viewing a single comment's thread. Return to all comments →
Same idea, but if d is an integer with no restrictions, this works:
shifted = a[d%n:] + a[:d%n] for num in shifted: print(num, end=' ')
Seems like cookies are disabled on this browser, please enable them to open this website
Left Rotation
You are viewing a single comment's thread. Return to all comments →
Same idea, but if d is an integer with no restrictions, this works: