我想将普通列表(main_list)转换为嵌套列表(ans_list),但我不知道如何。
main_list = [1, 2, 3, 4, 5, 6, 7, 8, 9] ans_list = [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
python
python ×1