学校举办编程竞赛,满分100分。小辉统计了全班15人的成绩:scores = [85, 92, 100, 78, 100, 88, 95, 100, 82, 90, 100, 76, 89, 100, 91]。想知道有多少人获得满分,应该用哪个方法?( )
A:scores.index(100)
B:scores.count(100)
C:scores.find(100)
D:scores.max()
正确答案:B
答案解析
count()统计指定元素出现次数,返回5;index()只返回第一次位置;find()是字符串方法;max()找最大值。
试卷来源:202609 青少年软件编程等级考试Python二级真题