py: tasks from codewars
def alphabet_position(text):
import string
s=''
text=text.lower()
for i in text:
try:
if i != ' ' and i !="'":
print (string.ascii_lowercase.index(i)+1)
s=s+str(string.ascii_lowercase.index(i)+1)+' '
else:
continue
except:
continue
return s.rstrip()#rstrip() deletes space from the end of a string
passLast updated