Guest User

Untitled

a guest
Apr 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #!/usr/bin/env python3.6
  2.  
  3. word = input("Введите фразу:\n")
  4. shift = 3 # Сдвиг
  5.  
  6. encode = "".join([chr(ord(x) + shift) for x in word])
  7. print("\nЗашифровано:\n" + encode + "\n")
  8.  
  9. decode = "".join([chr(ord(x) - shift) for x in encode])
  10. print("Дешифровано:\n" + decode + "\n")
Add Comment
Please, Sign In to add comment