Skip to content

Instantly share code, notes, and snippets.

@yaraxxx
Created February 26, 2020 16:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
The Rotating Digits
import collections
def cal(number , rotaions):
numbersList = collections.deque()
for d in str(number):
numbersList.append(int(d))
numbersList.rotate(int(rotaions))
return numbersList
def main():
k = int(input())
for case in range(k):
line = input()
num , r = line.split()
print(case+1,".",end='')
numbersList = cal(num,r)
for num in numbersList:
print(num,end='')
print()
if __name__=="__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment