Luke TateCourses Plus Student 2,244 Points
Why doesn't 'items' work, in the for loop when accessing strictly, either key or value?
I'm taking the last quiz, so I'm given a couple of fill in the blanks that deal with filling out for loops of either finding the key, or value. For example:
for key in student.__():
Whenever I type "items", "key",and "value" on both questions, I always get an error.
Plus, no tutorial, on packing or iteration of dictionaries dealt with only asking for only one or the other(key, or value).
# They asked 3 fill in for loop questions # Complete this code so that it will iterate over all the key:value pairs in the student dictionary. # Here they want it to iterate over all key:value pairs, in this case you would use ".items()" #Complete the code so it will iterate over only the keys in the student dictionary. # Here they asked only for the keys in the dictionary, you would do this using the ".keys()" #Complete the code so it iterates over only the values in the student dictionary. # And for the last they need only the values, you would use ".values()" # ps. just remember this # **kwargs packs dictionary # *args packs tuple