Question: Write a python function printWithAge that takes as parameters a JSON file name and an age and prints out the name of each player that

Write a python function printWithAge that takes as parameters a JSON file name and an age and prints out the name of each player that is that age:

NOTE: we did this before with csv files, but json files and the python json library make this much easier.

>>> printWithAge('cubsRoster.json', 35)

Tony Barnette

Cole Hamels

Jon Lester

[ { "firstName": "Jim", "lastName": "Adduci", "age": 34, "country": "CA" },

{ "firstName": "Tony", "lastName": "Barnette", "age": 35, "country": "US" },

{ "firstName": "Cole", "lastName": "Hamels", "age": 35, "country": "US" },

{ "firstName": "Jon", "lastName": "Lester", "age": 35, "country": "US" },

]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!