Question: Write a program that creates a dictionary with the following items: {'a':15, 'c':35, 'b':10}. Write one or more statements to: a. print all the
Write a program that creates a dictionary with the following items: {'a':15, 'c':35, 'b':10}. Write one or more statements to: a. print all the keys. b. print all the values. c. print all the keys and values pairs in tabular format. d. print all the keys and values pairs in tabular format ordered by key. e. print all the keys and values pairs in tabular format ordered by value. Here is a sample run: Keys: acb Values: 15 35 10 Key-Value pairs a 15 c 35 b 10 Key-Value pairs- sorted by key a 15 b 10 c 35 Key-Value pairs- sorted by value b 10 a 15 c 35
Step by Step Solution
3.54 Rating (161 Votes )
There are 3 Steps involved in it
Create a dictionary mydict a 15 c 35 b 10 a Print all the keys k... View full answer
Get step-by-step solutions from verified subject matter experts
