for i in range(4):if i%2==0:print(i)breakprint(i)
A: 00
B: 01
C: 22
D: 02
A: 00
B: 01
C: 22
D: 02
举一反三
- for i in range(4): if i%2==0: print(i) break print(i) 结果是
- 编写一段代码使用for循环输出1~10之内的奇数,以下哪些选项的结果是正确的?( ) A: for i in range(10): if i % 2 == 1: print(i) B: for i in range(9): if i % 2 == 0: print(i) C: for i in range(11): if i % 2 == 1: print(i) D: for i in range(12): if i % 2 = 0: print(i)
- 下列程序的执行结果是( ).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
- for i in range(1,5): if i%2==0: print(i) break
- 下面代码的运行结果是:for i in range(2):print(i, end='')else:print(0) A: 010 B: 012 C: 0102 D: 01