Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print "input:"
- inp = raw_input()
- length = len(inp)
- realKey = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
- subKey = ["D","T","X","C","U","I","Q","V","M","R","W","F","Z","G","P","L","H","A","O","Y","K","N","E","B","S","J"]
- def subsCipher():
- out=""
- i=0
- while i < length:
- decVal = ord(inp[i])
- if decVal>=65 and decVal<=90:
- j=0
- while j<26:
- if inp[i]==subKey[j]:
- break;
- j+=1
- out += realKey[j]
- else:
- out += inp[i]
- i+=1
- return out
- outp = subsCipher()
- print outp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement