下列语句中,循环次数最多的是( )
A: for x in range(1,5)
B: for x in range(0,5)
C: for x in range(2,5)
D: for x in range(1,5,2)
A: for x in range(1,5)
B: for x in range(0,5)
C: for x in range(2,5)
D: for x in range(1,5,2)
举一反三
- 下列语句中,循环次数最少的是( ) A: for x in range(1,10) B: for x in range(2,10) C: for x in range(3,10) D: for x in range(1,20)
- 执行y=[x for x in range(5) if x%2==1]后,y结果是( )。 A: [1, 3, 5] B: [0, 2, 4] C: [1, 3] D: [2, 4]
- 已知 x = [1, 2, 3, 2, 3] ,执行语句 for i in range(5): x.pop() 之后x 的值为
- list(map(lambda x, y: x+y, range(5), range(5, 10)))运行结果正确的是( )。 A: ['5', '7', '9', '11', '13'] B: [5, 7, 9, 11, 13] C: ['0', '1', '2', '3', '4'] D: [0, 1, 2, 3, 4]
- set1 = {x for x in range(10) if x%2!=0} print(set1) 以上代码的运行结果为? A: {1, 3, 5, 7, 9} B: {1, 3, 5, 7} C: {3, 5, 7, 9} D: {3, 5, 7}