daily pastebin goal
43%
SHARE
TWEET

Untitled

a guest Aug 15th, 2018 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. list_A="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  2. list_a=list_A.lower()
  3. list_0="0123456789"
  4.  
  5. def rot_a(c,k):
  6.     if list_A.find(c) >=0:
  7.         list= list_A
  8.     elif list_a.find(c) >=0:
  9.         list= list_a
  10.     elif list_0.find(c) >=0:
  11.         list= list_0
  12.     else:
  13.         return c
  14.    
  15.     l = len(list)
  16.     position = list.find(c)
  17.     p= (position + k) % l
  18.     return list[p]
  19.    
  20. def rot(c,k):
  21.     l=len(c)
  22.     p=""
  23.     for i in range(l):
  24.         p+=rot_a(c[i],k)
  25.     return p
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top