import json num = 5res = {}for i in range(num): res[i] = 'hui'jsnon = json.dumps(res, indent= 4, separators=(',', ': '))print(jsnon)
Standard input is empty
{ "0": "hui", "1": "hui", "2": "hui", "3": "hui", "4": "hui" }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!