Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNicholas Dallas
2,691 PointsRecap of iterating and packing with dictionaries 2 & 3
I tried both methods that they went over in the video.
I tried
.items() .**kwargs()
I don't see the kwargs working there but I tried it anyway. I may have missed another technic in the video that I'm just not understanding.
Thank you in advance.
1 Answer
Pratham Mishra
14,191 PointsYou are not supposed to put the parenthesis with **kwarags
Pratham Mishra
14,191 PointsPratham Mishra
14,191 PointsI am assuming that's the problem, I cannot figure out the exact problem as you've not attached ur code. It'll be great if you do so.
Nicholas Dallas
2,691 PointsNicholas Dallas
2,691 Pointsstudent = {'name': 'Craig', 'major': 'Computer Science', 'credits': 36}
for key, val in student.item(): print(key) print(value)
Nicholas Dallas
2,691 PointsNicholas Dallas
2,691 PointsComplete the code so it will iterate over only the keys in the student dictionary.
student = {'name': 'Craig', 'major': 'Computer Science', 'credits': 36}
for key in student.items(): print(key)
Nicholas Dallas
2,691 PointsNicholas Dallas
2,691 Pointsit was For key in student.keys()
I ended up figuring it out
Thank you, Nicholas