资讯动态

python3报错:TypeError: 'type' object is not subscriptable

发布时间:2026/10/19 22:56:49 来源:尧图企业网站定制
项函数传递列表时报错 TypeError: ‘type’ object is not subscriptabledef maxArea(self, height: list[int]) - int: return 0 c[1,2] self[] print(maxArea(self,c))将list[int]改为list即可def maxArea(self, height: list) - int: return 0 c[1,2] self[] print(maxArea(self,c))

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价 →
↑