Python Program is not working

Problem description
Given a JSON file which will define an array of bond objects (of arbitrary size), write a command-line tool to calculate the spread between each corporate bond and the nearest government bond benchmark, save these results in a JSON file, and express the spread in basis points, or bps. If any properties are missing from a bond object, do not include it in your calculations or output.

Spread is defined as the difference between the yield of a corporate bond and its government bond benchmark.

A government bond is a good benchmark if it is as close as possible to the corporate bond in terms of years to maturity, also known as term or tenor.

If there is a tie for closest government bond by tenor, break the tie by choosing the government bond with the largest amount outstanding.

To convert your difference to basis points, just scale your spread by 100 and display as an integer (truncate trailing decimals), e.g. if your spread comes out to 2.127, this will be expressed in your output file as “212 bps”.

Sample input
{
“data”: [
{
“id”: “c1”,
“type”: “corporate”,
“tenor”: “10.3 years”,
“yield”: “5.30%”,
“amount_outstanding”: 1200000
},
{
“id”: “g1”,
“type”: “government”,
“tenor”: “9.4 years”,
“yield”: “3.70%”,
“amount_outstanding”: 2500000
},
{
“id”: “c2”,
“type”: “corporate”,
“tenor”: “13.5 years”,
“yield”: null,
“amount_outstanding”: 1100000
},
{
“id”: “g2”,
“type”: “government”,
“tenor”: “12.0 years”,
“yield”: “4.80%”,
“amount_outstanding”: 1750000
}
]
}
Sample output
{
“data”: [
{
“corporate_bond_id”: “c1”,
“government_bond_id”: “g1”,
“spread_to_benchmark”: “160 bps”
}
]
}

Can someone please provide solution for this problem