多彩编程 多彩编程MZPH · CODE BLOG
ARTICLE DETAIL

文章详情

深耕前端与后端开发技术的一线实战笔记与踩坑复盘。

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

python3报错:TypeError: 'type' object is not subscriptable 项函数传递列表时报错 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))
返回列表