Problem 1 (Displaying a Dictionary) Add the following function display (d) that takes a dictionary as a parameter to your program. This function prints the elements of the dictionary to the terminal (in no particular order). def display (d): for key in d: print(key,":", d[key]) Sample run: >>> d = {'a':1, 'b':2, 'c':3} >>> print (d) {'a': 1, 'b': 2, 'c': 3} >>> display (d) a: 1 b: 2 C: 3

icon
Related questions
Question
Please I would love to have a cleared zoom in screenshot of code!!. Thanks. IN PYTHON PLEASE
Problem 1 (Displaying a Dictionary)
Add the following function display (d) that takes a dictionary as a parameter to your
program. This function prints the elements of the dictionary to the terminal (in no particular
order).
def display (d):
for key in d:
print(key," : ", d[key])
Sample run:
>>> d = {'a':1, 'b':2, 'c':3}
>>> print (d)
{'a': 1, 'b': 2, 'c': 3}
>>> display (d)
a : 1
b: 2
C: 3
Problem 2 (Safe Add)
Transcribed Image Text:Problem 1 (Displaying a Dictionary) Add the following function display (d) that takes a dictionary as a parameter to your program. This function prints the elements of the dictionary to the terminal (in no particular order). def display (d): for key in d: print(key," : ", d[key]) Sample run: >>> d = {'a':1, 'b':2, 'c':3} >>> print (d) {'a': 1, 'b': 2, 'c': 3} >>> display (d) a : 1 b: 2 C: 3 Problem 2 (Safe Add)
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.