Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Introducing Dictionaries Iterating and Packing with Dictionaries Recap of Iterating and Packing with Dictionaries

Ronald Greer
seal-mask
.a{fill-rule:evenodd;}techdegree
Ronald Greer
Front End Web Development Techdegree Student 51,752 Points

Can anyone help me with these fill in the blank questions?

All three of the fill in the blank questions are stumping me and are getting quite frustrating, if any one could provide an answers or point me into the direction of them, that would be great.

2 Answers

Hey Ronald, I took some time to look at the question and good news! I have results! This one was just reviewing the video to understand what to put for multiple values.

student = {'name': 'Craig', 'major': 'Computer Science', 'credits': 36}

for key, val in student.items():
    print(key)
    print(value)

Notice how we just put ".items" after students.

This next one changed a little bit but the question did say the answer.

student = {'name': 'Craig', 'major': 'Computer Science', 'credits': 36}

for key in student.keys():
    print(key)

This one had ".keys" instead as we are only wanting to display the "key" values in the iteration.

The same thing goes for this next question, but you would just have to spell out the whole word for "values" as the question is asking to only display the "vals" in the iteration.

student = {'name': 'Craig', 'major': 'Computer Science', 'credits': 36}

for val in student.values():
    print(val)

The last question I think you may figure out as it's a true or false question. But do review the videos before the quiz if you get stuck. Slow down and do your best to understand the information and It will make sense the next time coming around.

Good Luck!

Anytime! Let me know if I can help again. I need all the practice I can get too!