#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    55
    Rep Power
    2

    Need help with dictionary program


    Produce a dictionary that has as keys the names of the actors and as values lists of all the movies an actor has starred in. Provide a lookup function that takes the name of an actor as argument and prints the list of movies the actor has been in (or a message that the actor cannot be found). Use the data provided in the file i attached for your dictionary.

    how can i do this?
    Attached Files
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    194
    Rep Power
    3
    Originally Posted by kidoman
    Produce a dictionary that has as keys the names of the actors and as values lists of all the movies an actor has starred in. Provide a lookup function that takes the name of an actor as argument and prints the list of movies the actor has been in (or a message that the actor cannot be found). Use the data provided in the file i attached for your dictionary.

    how can i do this?
    Do you know how to open a file?
    Do you know how to create an empty dictionary?
    Do you know how to add items to a dictionary?
    Do you know how to show that you have made an effort to solve a problem?

    -Mek
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    55
    Rep Power
    2
    Originally Posted by Mekire
    Do you know how to open a file?
    Do you know how to create an empty dictionary?
    Do you know how to add items to a dictionary?
    Do you know how to show that you have made an effort to solve a problem?

    -Mek

    I know how to open a file but ive never done any dictionary programs, ive only been programming for 3weeks.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    31
    Rep Power
    2
    This question is easily answered by a Google search
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2009
    Posts
    530
    Rep Power
    34
    "Think Python",s chapter on dictionaries. Also, the python.org wiki has links to tutorials.

IMN logo majestic logo threadwatch logo seochat tools logo