Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82064

Nested dictionaries from a list ?

Newsgroups comp.lang.python
Date 2014-12-07 08:18 -0800
Message-ID <72066852-b4a1-4820-b52a-be56f68a0d7b@googlegroups.com> (permalink)
Subject Nested dictionaries from a list ?
From Wacky <waqar.hafiz@gmail.com>

Show all headers | View raw


New to Python, so please go easy.
I've a list of users, who have different profiles on different computers. How to tackle this through lists and dictionaries? Here is the data example. More interested in learning how to declare this structure and add/delete/extract values from whatever data structure is proposed.

users = [ 'Tom', 'Dick', 'Harry' ]

{ 'Tom': { 'computerA: 'Profile101'
           'computerB: 'Profile102'
           'computerC: 'Profile103' }

{ 'Dick': { 'computerA: 'Profile389'
            'computerB: 'Profile390' }

{ 'Harry': { 'computerA: 'Profile201'
             'computerB: 'Profile202'
             'computerC: 'Profile203'
             'computerD: 'Profile204' }

Thanks in advance

Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Nested dictionaries from a list ? Wacky <waqar.hafiz@gmail.com> - 2014-12-07 08:18 -0800
  Re: Nested dictionaries from a list ? Dave Angel <davea@davea.name> - 2014-12-07 12:01 -0500
    Re: Nested dictionaries from a list ? Denis McMahon <denismfmcmahon@gmail.com> - 2014-12-07 23:52 +0000
      Re: Nested dictionaries from a list ? Dave Angel <davea@davea.name> - 2014-12-08 08:35 -0500
  Re: Nested dictionaries from a list ? Denis McMahon <denismfmcmahon@gmail.com> - 2014-12-07 23:49 +0000

csiph-web