如何将字符串拆分为python中不包含空格的单词?

alw*_*btc 4 python string whitespace list

我的字符串是:

"This     is a      string"
Run Code Online (Sandbox Code Playgroud)

我想把它变成一个列表:

["This", "is", "a", "string"]
Run Code Online (Sandbox Code Playgroud)

我使用该split(" ")方法,但它添加了空格作为列表元素.请帮忙,

最好的祝福

akh*_*hab 11

>>> v="This is a  string"

>>> v.split()
['This', 'is', 'a', 'string']
Run Code Online (Sandbox Code Playgroud)

只是用split().