permute_by 函数
按照排列给出的一基位置重新排列列表。
语法
permute_by(list, permutation)apply_permutation(list, permutation)
参数与选项
list | 形如 [1, 2, 3] 的列表字面量。 |
|---|---|
permutation | 用于重新排列列表的一基位置序列。 |
示例
- 应用排列
permute_by([a, b, c], [3, 1, 2])返回 [c, a, b]。
按照排列给出的一基位置重新排列列表。
permute_by(list, permutation)apply_permutation(list, permutation)list | 形如 [1, 2, 3] 的列表字面量。 |
|---|---|
permutation | 用于重新排列列表的一基位置序列。 |
permute_by([a, b, c], [3, 1, 2])返回 [c, a, b]。