0

I am a beginner Python programmer. I am trying to turn each letter of the alphabet into their corresponding numbers (a=1, b=2...). I have tried using re.sub but since I can only substitute one character at a time, it requires 26 passes to translate just one character. Is there a better way to do this?

0 Answers0