Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 10 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
HeyItsAlicia: Why was questioncove not working??
3 hours ago 2 Replies 1 Medal
Countless7Echos: Ah trying out the whole T.V girl drawing :p (I love drawing eyes)
13 hours ago 14 Replies 6 Medals
kaelynw: starting to draw a hand
2 days ago 17 Replies 2 Medals
Twaylor: Rate it :D (Took 2 days)
6 days ago 7 Replies 0 Medals
XShawtyX: Art, Short Writing Assignment: Imagining Landscapes
2 days ago 9 Replies 1 Medal
XShawtyX: Chemistry, Help ud83dude4fud83cudffe
1 week ago 13 Replies 1 Medal
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!