Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 42 Online
OpenStudy (anonymous):

Stuck on PS8, Problem 2. Question is: Do you convert the subjects dictionary into a list before applying the optimization algorithms? If not, how do you find the subject name (the dictionary key), based on the (work, value) pair (the dictionary value)?

OpenStudy (anonymous):

[key for key, value in dictionary.iteritems() if value == (work, value)] should return a list of keys whose values meet the criteria. you get to decide whether to work with the dictionary or with lists. there are a number of ways to solve these. if you use dictionary methods to get lists of the keys and values, the order of the two lists are guaranteed to be maintained http://docs.python.org/library/stdtypes.html#dict.items

OpenStudy (anonymous):

If you decide to generate a list of subject keys, an easy way is: subject_list = subjects.keys()

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
whiteybulger: Should I drop this song i made last night in the studio
14 hours ago 50 Replies 0 Medals
Stewart: How do you know which tribe belongs to which reservation?
19 hours ago 2 Replies 0 Medals
randogirl123: me as hello kitty!! Still needs improvements, let me know what you thinkk
16 hours ago 32 Replies 2 Medals
Breathless: What is vaka blast made out of?
1 day ago 3 Replies 0 Medals
EdwinJsHispanic: another singing vid but for the people who knows spanish
1 day ago 16 Replies 1 Medal
EdwinJsHispanic: another singing vid, please give me your thoughts on it
1 day ago 20 Replies 2 Medals
SwaggyMark: Need help on process of annuity problem
2 days ago 3 Replies 0 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!