Question
Hi There, Kindly assist with below debugging and present final code with correct indentation as well as an explanation of what was done: file: debugging.py
Hi There, Kindly assist with below debugging and present final code with correct indentation as well as an explanation of what was done:
file: debugging.py
There are bugs in the code that need to be resolved.
Debug the Python code and ensure that you get the suggested output as outlined in the comments at the bottom of the debugging.py file.
For each bug that you have resolved, please leave a comment identifying the change that you made.
The CODE that needs debugging:
def print_values_of(dictionary, keys):
for key in keys:
print(dictionary[k])
simpson_catch_phrases = {"lisa": "BAAAAAART!", "bart": "Eat My Shorts!", "marge": "Mmm~mmmmm", "homer": 'd'oh', "maggie": " (Pacifier Suck)"}
print_values_of(simpson_catch_phrases, 'lisa', 'bart', 'homer')
*************
'''
Expected console output:
BAAAAAART!
Eat My Shorts!
d'oh!
'''
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started