MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / numbers_to_letter

Method numbers_to_letter

ciphers/polybius.py:38–49  ·  view source on GitHub ↗

Return the letter corresponding to the position [index1, index2] in the polybius square >>> PolybiusCipher().numbers_to_letter(4, 5) == "u" True >>> PolybiusCipher().numbers_to_letter(1, 1) == "a" True

(self, index1: int, index2: int)

Source from the content-addressed store, hash-verified

36 return indexes
37
38 def numbers_to_letter(self, index1: int, index2: int) -> str:
39 """
40 Return the letter corresponding to the position [index1, index2] in
41 the polybius square
42
43 >>> PolybiusCipher().numbers_to_letter(4, 5) == "u"
44 True
45
46 >>> PolybiusCipher().numbers_to_letter(1, 1) == "a"
47 True
48 """
49 return self.SQUARE[index1 - 1, index2 - 1]
50
51 def encode(self, message: str) -> str:
52 """

Callers 1

decodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected