Skip to main content
 首页 » 编程设计

python之如何使用 Python 中的列表生成所有可能的排列对

2025年05月04日13freeliver54

<分区>

如何从 Python 中的列表生成所有可能的对排列?

例子:

input = [3, 8, 2] 
output = ['3-8', '3-2', '8-3', '8-2', '2-3', '2-8']