下面代码的输出结果是()。 list1
= []
for
i in range(1,11):
list1.append(i**2) print(list1)
A: [1,
4, 9, 16, 25, 36, 49, 64, 81, 100]
B: ----Python:----A
Superlanguage
C: 错误
D: [2,
4, 6, 8, 10, 12, 14, 16, 18, 20]
= []
for
i in range(1,11):
list1.append(i**2) print(list1)
A: [1,
4, 9, 16, 25, 36, 49, 64, 81, 100]
B: ----Python:----A
Superlanguage
C: 错误
D: [2,
4, 6, 8, 10, 12, 14, 16, 18, 20]
举一反三
- 下面代码的输出结果是 ls = [] for i in range(1,11): ls.append(i**2) print(ls) A: [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] B: [2, 4, 6, 8, 10, 12, 14, 16, 18, 20,22] C: [1, 4, 9, 16, 25, 36, 49, 64, 81, 100,121] D: [11,22,33,44,55,66,77,88,99,1010,1111]
- 下面代码的输出结果是()。 list1<br/>= [i*2 for i in 'Python'] print(list1) A: ['PP',<br/>'yy', 'tt', 'hh', 'oo', 'nn'] B: Python Python C: 错误 D: [2, 4, 6, 8, 10, 12]
- 以下代码的输出结果是( ) for var range(8,20,4):[br][/br] print(var) A: 8 12 16 B: 8 12 16 20 C: 1 2 3 4 D: 12 16 20
- 下列代码的执行结果是( )<br/>list1=[1,2,3]<br/>list1.append([4,5])<br/>print(len(list1)) A: 3 B: 4 C: 5 D: 6
- 下列语句的执行结果是() a = 1 for i in range(5): if i == 2:[br][/br] break[br][/br] a += 1[br][/br] else: a += 1[br][/br] print(a) A: 2 B: 3 C: 4 D: 5