Advertisement
bl00dt3ars

Chat

Nov 26th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.87 KB | None | 0 0
  1. #coding
  2. text = input()
  3. e_is_found = False
  4. n_is_found = False
  5. first = 0
  6. second = 0
  7.  
  8. for i in range(len(text)):
  9.     if text[i] == "e":
  10.         e_is_found = True
  11.         first = text[i]
  12.         continue
  13.     if e_is_found:
  14.         if n_is_found:
  15.             if text[i] == "d":
  16.                 print("end")
  17.                 break
  18.             else:
  19.                 print(ord(first))
  20.                 print(ord(second))
  21.                 e_is_found = False
  22.                 n_is_found = False
  23.         if text[i] == "n":
  24.             n_is_found = True
  25.             second = text[i]
  26.             continue
  27.         else:
  28.             print(ord(first))
  29.             e_is_found = False
  30.     print(ord(text[i]))
  31.  
  32. # decoding
  33. massage = ""
  34. command = input()
  35. while command != "end":
  36.     text = int(command)
  37.     massage += chr(text)
  38.     command = input()
  39. else:
  40.     print(massage)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement