Posts by Oberdan Cavalcante • 9 points
1 post
-
0
votes3
answers11827
viewsA: Use list as dictionary value using Python append() method
>>> dic = {} >>> lis = [1, 2, 3] >>> dic['num'] = lis[:] #criando cópia não gera vinculo com a lista >>> print(dic) {'num': [1,2,3]}