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 48,792 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

David Loder
David Loder
4,901 Points

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!

David Loder
David Loder
4,901 Points

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