Arrange the triagram value of each letter of `message_part` vertically and join them horizontally. >>> __encrypt_part('ASK', TEST_CHARACTER_TO_NUMBER) '132111112'
(message_part: str, character_to_number: dict[str, str])
| 21 | |
| 22 | |
| 23 | def __encrypt_part(message_part: str, character_to_number: dict[str, str]) -> str: |
| 24 | """ |
| 25 | Arrange the triagram value of each letter of `message_part` vertically and join |
| 26 | them horizontally. |
| 27 | |
| 28 | >>> __encrypt_part('ASK', TEST_CHARACTER_TO_NUMBER) |
| 29 | '132111112' |
| 30 | """ |
| 31 | one, two, three = "", "", "" |
| 32 | for each in (character_to_number[character] for character in message_part): |
| 33 | one += each[0] |
| 34 | two += each[1] |
| 35 | three += each[2] |
| 36 | |
| 37 | return one + two + three |
| 38 | |
| 39 | |
| 40 | def __decrypt_part( |