Advertisement
skip420

007

Sep 23rd, 2021
977
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. # Python for the moment.....
  2. # We will make it simple('py2')
  3. # 007.py
  4. # python 007.py
  5. # We take words, Then convert to int
  6. # When communicating over IRC or online platforms only your
  7. #reader is able to decipher from -input to -output.
  8. # Here, We will convert letters into "Double" Digit instead of the traditional method ( A=1) We want A=22 for example))
  9. #     “one” => 1
  10.     “twenty” => 20
  11.     “two hundred forty-six” => 246
  12.     “seven hundred eighty-three thousand nine hundred and nineteen” => 783919.
  13. # pip install word2number
  14.  
  15.  
  16.  
  17.  
  18. input = raw_input('Write Text: ')
  19. input = input.lower()
  20. output = []
  21. for character in input:
  22.     number = ord(character) - 96
  23.     output.append(number)
  24. print(output)
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement