Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list_A="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- list_a=list_A.lower()
- list_0="0123456789"
- def rot_a(c,k):
- if list_A.find(c) >=0:
- list= list_A
- elif list_a.find(c) >=0:
- list= list_a
- elif list_0.find(c) >=0:
- list= list_0
- else:
- return c
- l = len(list)
- position = list.find(c)
- p= (position + k) % l
- return list[p]
- def rot(c,k):
- l=len(c)
- p=""
- for i in range(l):
- p+=rot_a(c[i],k)
- return p
Add Comment
Please, Sign In to add comment