Skip to content

Instantly share code, notes, and snippets.

@TheAlchemistKE
Last active April 24, 2019 10:48
Show Gist options
  • Save TheAlchemistKE/450456484d5977700bf325bfbaed2325 to your computer and use it in GitHub Desktop.
Save TheAlchemistKE/450456484d5977700bf325bfbaed2325 to your computer and use it in GitHub Desktop.
Convertion of Letters in text into their corresponding positions in the alphabet.
def test_letter_to_numeral_convertion(plain_text=None):
for i, letter in enumerate(plain_text):
if i < len(plain_text):
numeral = ord(letter) - 96
print(i, numeral)
test_letter_to_numeral_convertion(plain_text="Lenny")
@TheAlchemistKE
Copy link
Author

TheAlchemistKE commented Apr 24, 2019

I am having a problem with the first index that's converted into the wrong position in the alphabet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment