下面代码的输出结果是__________。letter=['A','B','C','D','D','D']foriinletter:ifi=='D':letter.remove(i)print(letter)
A: ['A','B','C']
B: ['A','B','C','D','D']
C: ['A','B','C','D','D','D']
D: ['A','B','C','D']
A: ['A','B','C']
B: ['A','B','C','D','D']
C: ['A','B','C','D','D','D']
D: ['A','B','C','D']
举一反三
- 以下程序的输出结果是( )?letter = ['A','B', 'C', 'D', 'D']for i in letter: if i == 'D': letter.remove(i)print(letter) A: ['A','B', 'C', 'D'] B: ['A','B', 'C', 'D','D'] C: ['A','B', 'C', 'D','D','D'] D: ['A','B', 'C']
- 以下代码运行结果为:( )for letter in ' Happy': if letter == ' a': break print ('当前字母:',letter) A: H B: a C: p D: y
- ABCDEFGH Which letter is two to the left of the letter immediately to the right of the letter that is three to the right of the letter immediately to the left of the letter D A: B B: D C: E D: H
- 下面代码的输出结果是a=[1,2,3] for i in a[::-1]: print(i,end=",") A: 2,1,3 B: 3,2,1, C: 1,2,3 D: 3,1,2
- 下面代码的输出结果是a=[1,2,3] for i in a[::-1]: print(i,end=",") A: 2,1,3 B: 3,2,1, C: 1,2,3 D: 3,1,2