int to alphabet letter python

Solutions on MaxInterview for int to alphabet letter python by the best coders in the world

showing results for - "int to alphabet letter python"
Irene
07 Jun 2019
1from string import ascii_lowercase
2
3
4LETTERS = {letter: str(index) for index, letter in enumerate(ascii_lowercase, start=1)} 
5
6def alphabet_position(text):
7    text = text.lower()
8
9    numbers = [LETTERS[character] for character in text if character in LETTERS]
10
11    return ' '.join(numbers)
12