Maybe not an answer to your question, but a suggestion: Python often has built in tools doing the work for you. This question looks like an exercise for split():
sentence = "Humpty Dumpty sat on a wall" #input("Please type in a sentence: ")
print([word[0] for word in sentence.split()])