Ace school

with brainly

  • Get help from millions of students
  • Learn from experts with step-by-step explanations
  • Level-up by helping others

A community for students.

Exercise 3.4 people function I have spent a fair amount of time on trying to get this function to work and now it seems as if it does. It returns the correct answer but I am not convinced that it is the best way to implement it. def people(age): n1=[] for name, xxx in combined_dict.iteritems(): if age==xxx: n1.append(name) return n1 Thanks

MIT 6.189 A Gentle Introduction to Programming Using Python (OCW)
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

Like many of the exercises, insufficient thought was given when it was designed. I used similar technique and thought, too, that it was just plain silly to do it that way.
Thanks Screech,
We need to remember that these exercises are not always going to be the optimal way to do something but rather are designed to test what w know about something. In this case the test its about using dictionaries. How would you improve the way the question is asked?

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

I'm in the MOOC "Gentle Python" course. Often I'm torn on how to do these lessons. I assume we should try to become deeply familiar with Python basics as much as possible. Thus, I generally try to complete these MIT assignments using what we've learned in Gentle Python rather than jumping ahead to investigate new Python techniques. For example, I notice that frankdpnw used "iteritems()" to write code, which is ahead of me. I was able to finish the assignment without using that function but at the same time I read about it in Python documents and practiced using it just to have an understanding.

Not the answer you are looking for?

Search for more explanations.

Ask your own question