Guest User

Untitled

a guest
May 31st, 2018
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. alp_eng = str(list('''`1234567890-=qwertyuiop[]asdfghjkl;'zxcvbnm,./~!@#$%^&*()_+QWERTYUIOP{}ASDFGHJKL:"|ZXCVBNM<>?'''))
  3. alp_rus = str(list('''ё1234567890-=йцукенгшщзхъфывапролджэячсмитьбю.Ё!"№;%:?*()_+ЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭ/ЯЧСМИТЬБЮ,'''))
  4.  
  5. res = []
  6.  
  7. x = input("Введите текст: ")
  8.  
  9. for lit in x:
  10. if lit in alp_eng:
  11. i = alp_eng.index(lit)
  12. res.append(alp_rus[i])
  13. elif lit in alp_rus:
  14. i = alp_rus.index(lit)
  15. res.append(alp_eng[i])
  16.  
  17. print (''.join(res))
  18.  
  19.  
  20. input ()
Add Comment
Please, Sign In to add comment