请选出下列选项在python
shell运行之时会报错的选项( )
A: result=
[1,2,3]
B: result=
["1","2","3"]
C: result=
["1" + "2"]
D: result=
["1" + ["2"]]
shell运行之时会报错的选项( )
A: result=
[1,2,3]
B: result=
["1","2","3"]
C: result=
["1" + "2"]
D: result=
["1" + ["2"]]
举一反三
- 把下面代码补全:计算10的阶乘并输出。[br][/br] int result = 1; for(int i = 2; i <= 10; i++){ } System.out.println(“result=”+ result);
- 下面的方法,当输入为2的时候返回值是多少() publicstaticintgetValue(inti){[br][/br]intresult=0;[br][/br]switch(i){[br][/br]case1:[br][/br]result=result+i;[br][/br]case2:[br][/br]result=result+i*2;[br][/br]case3:[br][/br]result=result+i*3;[br][/br]}[br][/br]returnresult;[br][/br]} A: 0 B: 2 C: 4 D: 10
- 下列选项中为元组的是() A: a<br/>= (1, 2, 3) B: a<br/>= [1, 2, 3] C: a<br/>= {"one":1, "two":2} D: a<br/>= 1
- 以下代码执行的结果是:( )int i=2;int result = 0;switch (i) {case 1:result = result + i;case 2:result = result + i * 2;case 3:result = result + i * 3;}System.out.println(result); A: 0 B: 2 C: 4 D: 10
- 下面的方法,当输入为2的时候返回值是多少?( ) public static int getValue(int i) { int result = 0; switch (i) { case 1: result = result + i; case 2: result = result + i * 2; case 3: result = result + i * 3; } return result; }