【发布时间】:2019-12-10 04:33:11
【问题描述】:
我已经声明了一个列表并尝试打印它。这是我的代码:
list1 = ["hello", 23, 5.0, ["hi", 15,[2,3,4,'5',[3,7,8]]], "xyz"]
print(list1[3][2][2][2])
我收到以下错误:
Traceback (most recent call last):
File "C:/Users/ASUS/Desktop/Data/tr.py", line 2, in <module>
print(list1[3][2][2][2])
TypeError: 'int' object is not subscriptable
Process finished with exit code 1
【问题讨论】:
标签: python python-3.7