Advertisement
Dimaush

Abracadabra

Jan 2nd, 2025 (edited)
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. rus = 'АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя'
  2. abr = 'ÀÁÂÃÄżÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ÷ØÙÚÛÜÝÞŸàáâãäå¼æçèéêëìíîïðñòóôõö÷øùúûüýþÿ'
  3.  
  4. text = input()
  5. dictionary = dict()
  6. for c in text:
  7.     if c in rus:
  8.         dictionary = dict(zip(rus, abr))
  9.         break
  10.     elif c in abr:
  11.         dictionary = dict(zip(abr, rus))
  12.         break
  13.  
  14. print(''.join([dictionary.get(c, c) for c in text]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement