You can download this code by clicking the button below.
This code is now available for download.
This function converts all alphabetic characters in the input string to their positions in the alphabet (e.g., 'a' to 1, 'b' to 2, etc.).
Technology Stack : String manipulation
Code Type : Function
Code Difficulty : Beginner
def a_to_z(input_string):
result = {}
for char in input_string:
if char.isalpha():
result[char] = ord(char) - ord('a') + 1
return result