擅长:python、mysql、java
<p>您可以使用字典和列表来实现这一点</p>
<pre><code>word_dict = {'show': ['display', 'exhibit', 'convey', 'communicate', 'manifest', 'disclose'],
'slow': ['unhurried', 'gradual', 'leisurely', 'late', 'behind', 'tedious', 'slack'],
'dangerous': ['perilous', 'hazardous', 'uncertain']}
new_word_dict = {k:[l for l in v if len(l) > 7] for k,v in word_dict.items()}
for key in sorted(new_word_dict.keys()):
print(f"{key} : {new_word_dict[key]}")
</code></pre>
<p>输出</p>
<pre><code>dangerous : ['perilous', 'hazardous', 'uncertain']
show : ['communicate', 'manifest', 'disclose']
slow : ['unhurried', 'leisurely']
</code></pre>