你在寻找这样的东西吗:
#initialize variables
buffer = ""
words = list()
#get input
mystring = input("Enter the sentence you wish to be an acronym: ")
mystring_length = len(mystring)
#parse words
for i in range (0, mystring_length)
if mystring[i] == " "
words.append(buffer)
buffer = ""
else
buffer += mystring[i]
#add the final word to buffer
#as it is not followed by a space, it will not be added using the above algorithm
words.append(buffer)
buffer = ""
#loop through words
for i in range (0, len(words))
print(words[i], end="")
if (i != len(words))
print(".", end="")
为python编辑(我认为)