avatar Bite 302. Get and write all code from a JSON file

You are given a sample JSON file containing, among other things, PyBites code for two bites.

Your task is to complete the function to extract the code from the JSON file for each bite and write the code to a file, one file for each bite. The code will be in the "passing_code" key. See the docstring for more information. 

With successful code you will then be able to use it to get and save all of your own passing PyBites code (which can be found under Settings).

See my_code.json for the sample JSON file contents and structure. The test file shows the expected code output.

Login and get coding
go back Intermediate level
Bitecoin 3X

26 out of 28 users completed this Bite.
Will you be Pythonista #27 to crack this Bite?
Resolution time: ~50 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 1.5 on a 1-10 difficulty scale.
» You can do it! 😌

We use Python 3.8