• 2022-06-01
    设用列表来描述分数,scores = [88, 52, 96, 75, 97, 100]。以下选项中,哪些能够实现遍历列表里的分数,并在屏幕上打印输出(所有分数在一行打印,分数和分数之间用空格间隔)? 即,输出结果为:88 52 96 75 97 100
    A: scores = [88, 52, 96, 75, 97, 100]
    for score in scores: print(score, end=' ')
    B: scores = [88, 52, 96, 75, 97, 100]
    i = 0 while i < len(scores): print(scores[i], end = ' ') i += 1
    C: scores = [88, 52, 96, 75, 97, 100]
    for score in scores: print(score, end=', ')
    D: scores = [88, 52, 96, 75, 97, 100]
    i = 0 while i < len(scores): print(scores[i], end = ', ') i += 1