Creating Unique Dictionary Variables from List

Discussion in 'Python' started by Greg Corradini, Apr 11, 2007.

  1. Hello All,
    I'm attempting to create multiple dictionaries at once, each with unique
    variable names. The number of dictionaries i need to create depends on the
    length of a list, which was returned from a previous function.
    The pseudo code for this problem would be:

    returnedlist = [x,y,z]
    count = 0
    for i in returnedlist:
    if count < len(returnedlist):
    # then create a dictionary (beginning with variable dic) and add a
    unique ending such that
    # my final dictionary name would be dic + count for each i

    Any ideas about this?
    Greg


    --
    View this message in context: http://www.nabble.com/Creating-Unique-Dictionary-Variables-from-List-tf3560470.html#a9943320
    Sent from the Python - python-list mailing list archive at Nabble.com.
    Greg Corradini, Apr 11, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Greg Corradini
    Replies:
    5
    Views:
    288
    Bruno Desthuilliers
    Apr 12, 2007
  2. Greg Corradini
    Replies:
    2
    Views:
    595
    Dennis Lee Bieber
    Apr 11, 2007
  3. james_027
    Replies:
    1
    Views:
    319
    Marc 'BlackJack' Rintsch
    Aug 22, 2007
  4. ToshiBoy
    Replies:
    6
    Views:
    840
    ToshiBoy
    Aug 12, 2008
  5. Token Type
    Replies:
    9
    Views:
    349
    Chris Angelico
    Sep 9, 2012
Loading...

Share This Page