Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN PYTHON 3: Write a for loop that loops through a list of dictionaries. The code inside the loop will check if the dictionary contains
IN PYTHON 3:
Write a for loop that loops through a list of dictionaries. The code inside the loop will check if the
dictionary contains the key name. If the dictionary does contain the key name, then the code
will print the value of that key.
For example, if the list of dictionaries is the list defined below, the loop would print Fraiser and
Cindy.
person_1 = {'name': 'Fraiser', 'age': 52}
person_2 = {'name': 'Cindy', 'age': 46}
people_list = [person_1, person_2]
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