Ad

Can anyone help with this? The code is supposed to take a string such as "it is nine 'oclock" and output the numerical position of each letter(letters only). my ouput seems to match both examples given exactly, but still says incorrect. any suggestions would be appreciated.

import string

def alphabet_position(text):
    aaa = ""
    
    for i in text:
        if i.isalpha() == True:
            i = i.lower()
            aaa = aaa + str(string.ascii_lowercase.index(i) + 1 )
            aaa = aaa + " "
        else:
            pass
    
    print(aaa)