If I write an input like 'I like apples' then I want the output to be I.L.Apples, but I keep getting I.L.A.Apples. Can anyone help me on removing the 'A.' part?
user_input = input('Enter a sentence: ')
sentence = user_input.split()
a = ""
b = ""
lastword = user_input.split()[-1]
for i in sentence:
a = a + str(i[0]).upper() + '.'
b = lastword.title()
print(a+b)