Python Dict-List

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Dane R
    replied
    Thanks for your help........... ....

    Leave a comment:


  • WooDoo
    replied
    Code:
    dict = {'Alice': ["2","bookclub",],'Jane': ["3","mat club"]}
    for x,y in enumerate(dict):
        # x is the dict key
        # y is the list
        for item in dict[y]:#dict[y] is lookup the item with the dict key        
            print(y,item)

    Leave a comment:


  • Dane R
    replied
    sample of the dict

    Code:
    dict = {'Alice': ["2","bookclub",],'Jane': ["3","mat club"]}
    This is a sample of the dict, I need to print the person name and then the persons info next to their name
    Originally posted by WooDoo
    What do you mean get info list?

    Leave a comment:


  • WooDoo
    replied
    What do you mean get info list?

    Leave a comment:


  • Dane R
    started a topic Python Dict-List

    Python Dict-List

    If you have a dict with a list how do you get the info from the list.
Working...