我想知道shuffle string
示例字符串
string word;
//I want to shuffle it
word = "hello"
Run Code Online (Sandbox Code Playgroud)
我能得到:
rand == "ohlel"
rand == "lleho"
etc.
Run Code Online (Sandbox Code Playgroud) 刚开始使用python并且知道足够知道我什么都不知道.我想找到将列表拆分为dicts列表的替代方法.示例列表:
data = ['**adjective:**', 'nice', 'kind', 'fine',
'**noun:**', 'benefit', 'profit', 'advantage', 'avail', 'welfare', 'use', 'weal',
'**adverb:**', 'well', 'nicely', 'fine', 'right', 'okay']
Run Code Online (Sandbox Code Playgroud)
我能得到:
[{'**adjective**': ('nice', 'kind', 'fine'),
'**noun**': ('benefit', 'profit', 'advantage', 'avail', 'welfare', 'use', 'weal'),
'**adverb**': ('well', 'nicely', 'fine', 'right', 'okay')}]
Run Code Online (Sandbox Code Playgroud)