输入一个英文句子,每个单词间用空格分 隔,标点符号前面无空格,后面跟一个空 格,请将每个单词分行输出。

输入一个英文句子,每个单词间用空格分
隔,标点符号前面无空格,后面跟一个空
格,请将每个单词分行输出。

import string

p = string.punctuation

s = input(">>>").split()
s = [i[:-1] if i[-1] in p else i for i in s ]
for i in s:
    print(i)
    
--result
>>>Why this word does this, I haven't got a clue.
Why
this
word
does
this
I
haven't
got
a
clue