下列代码的执行结果为_________。for i in range(10,-2,-2): print(i,end=",")
A: 9,7,5,3,1,-1
B: 10,8,6,4,2,0
C: 10,8,6,4,2,0,-2
D: 10,8,6,4,2,1
A: 9,7,5,3,1,-1
B: 10,8,6,4,2,0
C: 10,8,6,4,2,0,-2
D: 10,8,6,4,2,1
举一反三
- >>>x= [10, 6, 0, 1, 7, 4, 3, 2, 8, 5, 9]>>>print(x.sort()) 语句运行结果正确的是( )。 A: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] B: [10, 6, 0, 1, 7, 4, 3, 2, 8, 5, 9] C: [10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0] D: ['2', '4', '0', '6', '10', '7', '8', '3', '9', '1', '5']
- 以下代码的输出结果是()for i in range(0,10,2): print(i,end="") A: 0 2 4 6 8 B: 2 4 6 8 C: 0 2 4 6 8 10 D: 2 4 6 8 10
- set1 = {x for x in range(10)} print(set1) 以上代码的运行结果为? A: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} B: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10} C: {1, 2, 3, 4, 5, 6, 7, 8, 9} D: {1, 2, 3, 4, 5, 6, 7, 8, 9,10}
- 以下程序的输出结果是___________。for i in range(1,11): print(i, end = " ") A: 1 2 3 4 5 6 7 8 9 B: 1 2 3 4 5 6 7 8 9 10 C: 1 2 3 4 5 D: 1 3 5 7 9
- list(range(-1,10,2)) A: [0, 2, 4, 6, 8, 10] B: [-1, 1, 3, 5, 7, 9] C: [0, 2, 4, 6, 8]