|
本帖最后由 VimVim 于 2020-7-28 09:32 编辑
python:
import random
YourEnglishSentence=input()
WordsList=YourEnglishSentence.split()
random.shuffle(WordsList)
print(WordsList)
例如:
>>> import random
>>> YourEnglishSentence="This is a red apple!"
>>> WordsList=YourEnglishSentence.split()
>>> random.shuffle(WordsList)
>>> print(WordsList)
['a', 'is', 'red', 'This', 'apple!']
>>> random.shuffle(WordsList)
>>> print(WordsList)
['This', 'apple!', 'a', 'red', 'is']
>>>
|
|