从压缩对象到列表的转换不起作用

时间:2019-10-26 16:46:30

标签: python python-3.x

尽管转换为列表,但我得到的是压缩的对象

import itertools as it
def combi(i,j):
    string_maps = {"1": "abc","2": "def","3": "ghi","4": "jkl","5": "mno","6": "pqrs","7": "tuv","8": "wxy","9": "z"}
    string_maps=dict((int(k),v) for k,v in string_maps.items())
    list1=[]
    list1.append(string_maps.get(i))
    list2=[]
    list2.append(string_maps.get(j))
    list_new =list([zip(x,list2) for x in it.permutations(list1,len(list2))])
    print(list_new)

combi(4,3)

0 个答案:

没有答案