执行下述代码:for i in range(5): if i <;= 2: i -= 1 print(i,end=',') elif i >; 2: i += 1 print(i,end=',')输出结果为()
A: -1,0,1,4,5,
B: -1,0,1,4,
C: -1,0,4,1,5,
D: -1,1,0,5,4,
A: -1,0,1,4,5,
B: -1,0,1,4,
C: -1,0,4,1,5,
D: -1,1,0,5,4,
举一反三
- 下列程序的执行结果是( ).for i in range(2): print(i,end=' ' )for I in range(4,6): print(I,end=' ' ) A: 2 4 6 B: 0 1 2 4 5 6 C: 0 1 0 1 2 3 D: 0 1 4 5
- 阅读下面Python代码,选择正确输出结果:() for i in range(5): if i == 3: continue print(i,end=" ") continue print(i,end=" ") A: 0 1 2 3 4 5 B: 0 1 2 3 4 C: 2000 1 2 D: 0 1 2 4
- 执行下述代码:[br][/br]for i in range(5):[br][/br] if i [= 2:<br] i -= 1[br][/br] print(i,end=',')[br][/br] elif i > 2:[br][/br] i += 1[br][/br] print(i,end=',')[br][/br]输出结果为() A: -1,0,1,4,5, B: -1,0,1,4, C: -1,0,4,1,5, D: -1,1,0,5,4,
- 执行下述代码:[br][/br]for i in range(5):[br][/br] if i [= 2:<br] i -= 1[br][/br] print(i,end=',')[br][/br] elif i > 2:[br][/br] i += 1[br][/br] print(i,end=',')[br][/br]输出结果为() A: -1,0,1,4,5, B: -1,0,1,4, C: 1,0,4,1,5, D: -1,1,0,5,4,
- 下面代码的输出结果为( ) for i in range(1, 7): if i % 2 == 0: print(i, end=" ") A: 1 2 3 4 5 6 7 B: 1 2 3 4 5 6 C: 2 4 6 7 D: 2 4 6