12、在Python中,numbers=[1, 2, 3, 4, 5],执行print(numbers[:4])的结果为A.[4]B.[5]C.[1, 2, 3, 4]D.[1, 2, 3, 4, 5]

12、在Python中,numbers=[1, 2, 3, 4, 5],执行print(numbers[:4])的结果为

A.[4]

B.[5]

C.[1, 2, 3, 4]

D.[1, 2, 3, 4, 5]


参考答案和解析
range

相关考题:

Python中若定义object=[1,2,3,4,5],则print(object[-4])输出() A、NULLB、2C、4D、程序报错

Python中若定义object=(1, 2, 3, 4, 5),则print(object[:3])输出() A.345B.34C.45D.123

在Python3.x中语句print(*[1,2,3])不能正确执行。此题为判断题(对,错)。

(12)下列程序段的执行结果是。 i=4 a=5 Do i=i+1 a=a+2 Loop Until i=7 Print"A=";a

下列代码的执行结果是______。int numbers[]=new int[6];for(int i=1;i<numbers.length;i++){numbers[i]=i-1;System.out.print(numbers[i]+"");}A) 0 1 2 3 4 5B) 1 2 3 4 5 6C) 0 1 2 3 4D) 1 2 3 4 5A.B.C.D.

有如下一个Sub过程: Sub mlt(ParamArray numbers()) n=1 For Each x In numbers n=n*x Next x Print n End Sub 在一个事件过程中如下调用该Sub过程: Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim c As Integer Dim d As Integer a=1 b=2 c=3 d=4 mlt a,b,c,d End Sub 该程序的运行结果为( )。A.12B.24C.36D.48

下列程序段的执行结果为( )。 a=1 b=1 For I=1 To 3 f=a+b a=b b=f Print f: Next IA.2 3 6B.2 3 5C.2 3 4D.2 2 8

下列程序段的执行结果为 a=3:b=1 For i=1 To 3 f=a+b:a=b:b=f Print f Next IA.4 3 6B.4 5 9C.6 3 4D.7 2 8

下列程序的执行结果是______。 print(int*b,int m) { int i; for(i=0;i<m;i++) {*b=i; b++; } printf("%d\n",*--B) ; } main() { int a[5]=}1,2,3,4,5}; print(a,5);}A.5B.4C.3D.2

下列程序段的执行结果为 n=0 For i=1 To 3 For j=5 To 1 Step-1 n=n+1 Next j,i Print n;j;iA.12 0 4B.15 0 4C.12 3 1D.15 3 1

有如下一个Sub过程: Sub mlt (ParamArray numbers()) n=1 For Each x In numbers n=n * x Next x Print n End Sub在一个事件过程中如下调用该Sub过程: Private Sub Coinmand1_Click() Dim a As Integer Dim b As Integer Dim c As Integer Dim d As Integer a=1 b=2 c=3 d=4 mlt a,b,c,d End Sub 则运行该程序,结果为______。A.12B.24C.36D.48

在SQL Server2008的查询编辑器中运行下面的语句,得到的结果是( )。create table numbers(n1 int, n2 numeric(5,0), n3 numeric(4,2))go insert numbers values(1.5,1.5,1.5)select * from numbers A 返回2,2和1.50的记录集B 返回1,2和1.50的记录集C 返回1.5,1.5和1.5的记录集D create table 命令不会执行,因为无法将列n2的精度设置为0

下列程序段的执行结果为______。 x=5 y=3 If Not x > 1 Then y=y+1 Else x=x-1 Print x;yA.5 3B.5 4C.3 4D.4 3

下列程序段的执行结果为 a=3 b=1 For I=1 To 3 f=a + b a=b b=f Print f Next IA.4 3 6B.4 5 9C.6 3 4D.7 2 8

下列程序段的执行结果为 Dim A(10,10) For 1=2 To 4 For J=4 To 5 A(I,J)=I*J Next J Next I Print A(2,5)+A(3,4)+A(4,5)A.22B.42C.32D.52

Python3.x语句print(1,2,3,sep=’:’)的输出结果为()。

在Python3.x中语句print(*[1,2,3])不能正确执行。

单选题1)#include 2)usingnamespacestd; 3)intmain() 4){ 5)inta,b,result; 6)coutab; 8)result=3*a-2*b+1; 9)cout"resultis"Aplease input two numbers:的前面Bplease input two numbers:的后面Cplease input two numbers:的下一行首列D不确定

多选题If 4 more than twice n is a negative number and 6 more than n is a positive number, which of the following numbers could be the value of n? (Select all such numbers.)A-5B4C-3

单选题For the set of numbers 2,2,4,5, and 12, which statement is true?AMean = MedianBMean ModeCMean ModeDMode = MedianEMean = Mode

单选题1)#include 2)# include 3)using namespace std; 4)double max(double x,doubley); 5)void main() 6){ 7)double a,b,c; 8)cout ab; 10)c=max(a,b); 11)couty) 16)returnx; 17)else 18)returny; 19)}执行完第8行后,屏幕上输出:()Ainput two numbers:/nBinput two numbers:Ccout”input two numbers:/n”D”please input two numbers:/n”

单选题1)#include 2)usingnamespacestd; 3)intmain() 4){ 5)inta,b,result; 6)coutab; 8)result=3*a-2*b+1; 9)cout"resultis"Aplease input two numbers:/nBplease input two numbers:Ccout”please input two numbers:/n”D”please input two numbers:/n”

填空题Python3.x语句print(1,2,3,sep=’:’)的输出结果为()。

单选题If the average of the two-digit numbers 1N, N7, and NN is 35, then N= ______.A2B3C4D5E6

单选题1)#include 2)#include 3)using namespace std; 4)double max(double x,doubley) 5){ 6)if(xy) 7)return x; 8)else 9)return y; 10)} 11)int main() 12){ 13)doublea,b,c; 14)cout a b; 16)c=max(a,b); 17)cout " the squart of max imum=" sqrt( c ); 18)}执行完第14行后,命令提示符窗口中输出的结果是:()Ainputtwonumbers:/nBinputtwonumbers:Ccout” input two numbers:/n”D”input two numbers:/n”

单选题For which set of numbers do the average, median, and mode all have the same value?A2, 2, 2, 2, 4B1, 3, 3, 3, 5C1, 1, 2, 5, 6D1, 1, 1, 2, 5E1, 1, 3, 5, 10

问答题What is the value of the greater of two numbers if one of the numbers is three times the smaller number?  (1) one of the numbers is 12.  (2) The sum of the two numbers is 16.

单选题下列代码的执行结果是(  )。int numbers[] = new int[6];for(int i=1;i numbers[i] =i-1;System.out.print(numbers[i]+" ");}A0 1 2 3 4 5B1 2 3 4 5 6C-1 0 1 2 3 4 D0 1 2 3 4