python some beautiful code

1:{ i:i for i in range(i)}spa

2:dict([(i,i) for i in range(i)])code

# a = {'1': [1, 2, 5], '3': [6, 7], '2': [3, 4]}  --> {1: '1', 2: '1', 3: '2', 4: '2', 5: '1', 6: '3', 7: '3'}
{ x:i for i,j in monster_group.items() for x in j}

 

3:blog

 a = {'1': [1, 2, 5], '3': [6, 7], '2': [3, 4]}  --> {1: '1', 2: '1', 3: '2', 4: '2', 5: '1', 6: '3', 7: '3'}it

相關文章
相關標籤/搜索