Last active
April 24, 2019 10:48
-
-
Save TheAlchemistKE/450456484d5977700bf325bfbaed2325 to your computer and use it in GitHub Desktop.
Convertion of Letters in text into their corresponding positions in the alphabet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am having a problem with the first index that's converted into the wrong position in the alphabet.