convert list to a particular json in python
问题 I am working on a problem and my output is something like this: List with long string inside it ["21:15-21:30 IllegalAgrumentsException 1, 21:15-21:30 NullPointerException 2, 22:00-22:15 UserNotFoundException 1, 22:15-22:30 NullPointerException 1 ....."] I need to convert the data in something like this: response: [ { "time": "21:15-21:30", "logs": [ { "exception": "IllegalAgrumentsException", "count": 1 },{ "exception": "NullPointerException", "count": 2 } ] }, { "time": "22:00-22:15", "logs