MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / numbers_to_letter

Method numbers_to_letter

ciphers/bifid.py:40–52  ·  view source on GitHub ↗

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

(self, index1: int, index2: int)

Source from the content-addressed store, hash-verified

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

Callers 2

encodeMethod · 0.95
decodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected