Skip to content

Instantly share code, notes, and snippets.

@cod3smith
Last active April 24, 2019 10:48
Show Gist options
  • Select an option

  • Save cod3smith/450456484d5977700bf325bfbaed2325 to your computer and use it in GitHub Desktop.

Select an option

Save cod3smith/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")
@cod3smith
Copy link
Copy Markdown
Author

cod3smith 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