ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
1、len(),列表中有多少项 ``` numbers = [1,2,3] print len(numbers) ``` 2、count(),某个项有多少个 ``` color_List = ['red','blue','magenta','red','yellow'] print color_List.count('red') ``` 3、index(),查找某个值的索引![] ``` color_List = ['red','blue','magenta','red','yellow'] print color_List.index('blue') ```