Advertisement
skip420

decodemessagewithnumbers

Aug 2nd, 2022
1,077
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. # python3 encode.py "12"
  2.  
  3. #!/usr/bin/python3
  4. import sys
  5. import re
  6.  
  7. decoder = {4:'A', 7:'B', 5:'C', 9:'D', 6:'E', 8:'F', 10:'G', 24:'H', 1:'I', 25:'J', 15:'K', 14:'L', 12:'M', 13:'N', 3:'O', 11:'P', 16:'Q', 17:'R', 23:'S', 26:'T', 21:'U', 19:'V', 18:'W', 20:'X', 22:'Y', 2:'Z'}
  8.  
  9. inputList = re.sub('[^0-9\s]','',sys.argv[1]).split()
  10. print("input =", inputList)
  11. print("output = ", end='')
  12.  
  13. for i in inputList:
  14.     print(decoder.get(int(i),'?'),end='')
  15.  
  16. print('')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement