请教,Python有一段程序段其中的info[0][1]:是什么意思

Python020

请教,Python有一段程序段其中的info[0][1]:是什么意思,第1张

二维的数组,比如:

x = [[0] * 5] * 2

x[0][4] = 2

print(x)

输出了两个数组:

第一个的0位和第二个的4位赋值为2。

输出结果:

[[0, 0, 0, 0, 2], [0, 0, 0, 0, 2]]

>>> info='[{"username":"qian","age":"18","weight":"55"}]'

>>> eval(info)[0].get('age')

'18'

>>>