Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 14 - Tuples, Sets, and Dictionaries - Section 14.6 - Dictionaries - Check Point - MyProgrammingLab - Page 492: 14.22

Answer

(a) print(len(students)) This will print the number of elements in students dictionary that is 2. (b) print(students.keys()) This will print all keys of students which is ["john", "peter"] (c) print(students.values()) This will print all values of students which are [3, 2] (d) print(students.items()) This will give all tuples corresponding to (key, value) pairs in a special data structure called dict_items, it will print dict_items([('john', 3), ('peter', 2)])

Work Step by Step

No explanation needed.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.