Advertisement
selebry

sddsa

Nov 24th, 2023
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. # Создаем пустой словарь
  2. alphabet_map = {}
  3.  
  4. # Перебираем русский алфавит
  5. for i, letter in enumerate(' АБВГДЕЖЗИКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ'):
  6. # Преобразуем индекс в бинарное представление
  7. binary = bin(i)[2:]
  8. # Добавляем букву и ее бинарное представление в словарь
  9. alphabet_map[letter] = binary.zfill(5)
  10. if letter=='Е':
  11. alphabet_map['Ё'] = alphabet_map[letter]
  12. elif letter == 'И':
  13. alphabet_map['Й'] = alphabet_map[letter]
  14.  
  15. for letter, binary in alphabet_map.items():
  16. print(f"{letter}: {binary}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement