How to print value of special variable | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to print value of special variable

Hello! ------------------------------------------------------ jsona = [] file = open("newfile.json", "w") while (len(jsona))<250: c = (len(jsona)) a = 1 b = a + c n = {"time": b} jsona.append(n) if (len(jsona)) == 250: file.write(str(jsona)) file.close() print(jsona[54]) ------------------------------------------------------ I want to print a value from jsona[54] from time, but it prints {'time': 55}. How can I print 55?

19th May 2019, 3:50 PM
EkvirJD
EkvirJD - avatar
1 Answer
+ 2
print(jsona[54][‘time’])
19th May 2019, 4:40 PM
Choe
Choe - avatar