Question: 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
Get step-by-step solutions from verified subject matter experts
