Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi. First of all TY so much. I\'m trying to write a short python program that re

ID: 3645085 • Letter: H

Question

Hi. First of all TY so much. I'm trying to write a short python program that read a json file into a data structure (array or object), count the total number of course a student takes, then output the result to a new json file.

I get the idea but I'm still new to python in terms of syntax and this won't be the last time i program in python and I vow to study python by going over it after this but I'm running out of time and energy in terms of this particular program.

This is what the json file look like before reading:

[

{ "course": "abc",

"students": [

"a",
"b",
"c",
"d",
"e",
"f",
"g",
"z"

],

"title": "math"

},

{
"course": "zxc",

"students": [
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h"
],
"title": "english"
}
]

For the count number of course a student takes, for example: student "a" took 2 courses so inside the output file it would look like this:


"a" took 2 courses.
"z" took 1 course.

and so on...

I got the file to read and store into a variable (sorry if the syntaxs are wrong)

import json;
f=open("courses.json");
d = json.load(f);

After that I'm pretty much stuck, already not familiar with python syntax and json own syntax makes it even
more confusing.

Any response will be greatly appreciated.

Sincerely

Explanation / Answer

You are always welcome and will always find appreciating answers here,,,,

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote