following show the my list value (variable is "data")
[{'letters': ['R', 'V', 'X', 'U', 'M', 'Z', 'B', 'O', 'R'],
'words': ['RVX', 'BOM', 'RUB', 'RUZ', 'MBOOO', 'RMR'],
'score': 51},
{'letters': ['P', 'X', 'M', 'R', 'D', 'S', 'I', 'C', 'E'],
'words': ['PXM', 'RDS', 'ICE', 'PRI', 'DSCE', 'PXM', 'MRE'],
'score': 54}]
Then I used the following code
print(*data)
output was
{'letters': ['R', 'V', 'X', 'U', 'M', 'Z', 'B', 'O', 'R'], 'words': ['RVX', 'BOM', 'RUB', 'RUZ', 'MBOOO', 'RMR'], 'score': 51} {'letters': ['P', 'X', 'M', 'R', 'D', 'S', 'I', 'C', 'E'], 'words': ['PXM', 'RDS', 'ICE', 'PRI', 'DSCE', 'PXM', 'MRE'], 'score': 54}
but I want to get that output with comma with saparate two JSON
Like this
{'letters': ['R', 'V', 'X', 'U', 'M', 'Z', 'B', 'O', 'R'], 'words': ['RVX', 'BOM', 'RUB', 'RUZ', 'MBOOO', 'RMR'], 'score': 51},
{'letters': ['P', 'X', 'M', 'R', 'D', 'S', 'I', 'C', 'E'], 'words': ['PXM', 'RDS', 'ICE', 'PRI', 'DSCE', 'PXM', 'MRE'], 'score': 54}
Any one can help me
Thank you
>Solution :
Is this what you are trying to accomplish?
print(*data, sep=",\n")
That will put your items on separate lines, with commas after all but the last.