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

Function encode

ciphers/a1z26.py:12–17  ·  view source on GitHub ↗

>>> encode("myname") [13, 25, 14, 1, 13, 5]

(plain: str)

Source from the content-addressed store, hash-verified

10
11
12def encode(plain: str) -> list[int]:
13 """
14 >>> encode("myname")
15 [13, 25, 14, 1, 13, 5]
16 """
17 return [ord(elem) - 96 for elem in plain]
18
19
20def decode(encoded: list[int]) -> str:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected