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)
# TODO: Replace examples and use TDD by writing your own tests
# These are some of the methods available:
# test.expect(boolean, [optional] message)
# test.assert_equals(actual, expected, [optional] message)
# test.assert_not_equals(actual, expected, [optional] message)
# You can use Test.describe and Test.it to write BDD style test groupings