report['conditions'] += [
{
"name": cond,
"biRad": br,
"findings":
[
{
"name": f,
**if f == 'mass':**
"parameters":
[
{
"name": iter_params_mass[0],
"value": create_rep(iter_params_mass, row, f, r)[0]
},{...}
]
}
]
}]
I have very strict structure for my BSON file, but instead of creating everything manually, I would like to use if statement and for loop (if possible), because I can have more than 1 pair of name-value in parameters. Any efficient way to do it? Thanks! I'm using Python 3.6.0