首页 > 通信工程师
题目内容 (请给出正确答案)
[主观题]

运行以下程序,输出结果为()。lst1=[1,2,3,4,5] lst2=[i*2 for i in lst1] for i in lst2: print

(i,end='') #此处''为空字符串

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“运行以下程序,输出结果为()。lst1=[1,2,3,4,5…”相关的问题
第1题
有以下程序: main() { int x=5,y=2,z=1; printf("%d\n",x%y&~z); }程序运行后的输出结果为__

有以下程序: main() { int x=5,y=2,z=1; printf("%d\n",x%y&~z); }程序运行后的输出结果为______。

A.3

B.2

C.1

D.0

点击查看答案
第2题
编译运行以下程序后,关于输出结果的说明正确的是()。 public class Conditional{ public static

编译运行以下程序后,关于输出结果的说明正确的是()。 public class Conditional{ public static void main (String args[]){ int x=2: System.out.println("value is”+ ((x<1)?2:2)); } }

A.输出结果为:valueis22.2

B.输出结果为:value is 2

C.输出结果为:value is 2.0

D.编译错误

点击查看答案
第3题
以下的程序的调试结果为?public class MyAr{public static void main(String argv[]) {MyAr m = new MyAr();m.amethod();}public void amethod(){static int i;System.out.println(i);}}

A. 输出结果为 0

B. 运行出错

C. 输出结果为 null

D. 编译错误

点击查看答案
第4题
以下程序运行后,如果从键盘上输入ABCDEF<回车>,则输出结果为______。#include<stdio.h>#include<s

以下程序运行后,如果从键盘上输入ABCDEF<回车>,则输出结果为______。 #include<stdio.h> #include<string.h> func(char str[]) { int num=0; while(*(str+num)!='\0') num++; return(num);p } main() { char str[10],*p=str; gets(p);printf("%d\n",func(P)); }

A.8

B.7

C.6

D.5

点击查看答案
第5题
以下程序的编译运行结果为:1: public class Q102: {3: public static void main(String[] args)4

以下程序的编译运行结果为:

1: public class Q10

2: {

3: public static void main(String[] args)

4: {

5: int i = 10;

6: int j = 10;

7: boolean b = false;

8:

9: if(b = i == j)

10: System.out.println("True");

11: else

12: System.out.println("False");

13: }

14: }

A. 第9行出现编译错误;

B. 第9行出现运行错误;

C. 输出 True

D. 输出 False

点击查看答案
第6题
以下程序的运行结果为:1. public class Conditional {2. public static void main(String args [] ) {3. int x = 4;4. System.out.println("value is " +((x >4、? 99.99 : 9));5. }6. }

A. 输出:value is 99.99

B. 输出: value is 9

C. 输出: value is 9.0

D. 在第4行出现编译错误

点击查看答案
第7题
有以下程序: 程序运行后的输出结果是()。A.7.5B.31.5C.程序有错无输出结果D.14.0

有以下程序:

程序运行后的输出结果是()。

A.7.5

B.31.5

C.程序有错无输出结果

D.14.0

点击查看答案
第8题
编译和运行以下程序结果为:1: public class Q21 {2: int maxElements;3: void Q21() {4: maxEl

编译和运行以下程序结果为:

1: public class Q21 {

2: int maxElements;

3: void Q21() {

4: maxElements = 100;

5: System.out.println(maxElements);

6: }

7: Q21(int i) {

8: maxElements = i;

9: System.out.println(maxElements);

10: }

11: public static void main(String[] args) {

12: Q21 a = new Q21();

13: Q21 b = new Q21(999);

14: }

15: }

A. 输出100 和 999.

B. 输出999 和 100.

C. 第2行出现编译错误,变量 maxElements未初始化.

D. 12行出现编译错误.

点击查看答案
第9题
以下程序的调试结果为?class Base{public final void amethod(){System.out.println("amethod");}}public class Fin extends Base{public static void main(String argv[]){Base b = new Base();b.amethod();}}

A.编译指示带有final 方法的类自己必须定义为final

B.编译指示不能继承含有final 方法的类

C.运行错误,原因是Base类没有定义为final类

D.运行输出 amethod

点击查看答案
第10题
有如下Sub过程: Sub ind(a As Integer) Static x As Integer x= x + a Print x: End Sub 以下是

有如下Sub过程:

Sub ind(a As Integer)

Static x As Integer

x= x + a

Print x:

End Sub

以下是调用它的事件过程,程序运行后,单击命令按纽Command1三次,输出结果为【 】。

Private Sub Command1_Click()

Ind 2

End Sub

点击查看答案
第11题
以下程序的编译和运行结果为?abstract class Base{abstract public void myfunc();public void

以下程序的编译和运行结果为?

abstract class Base{

abstract public void myfunc();

public void another(){

System.out.println("Another method");

}

}

public class Abs extends Base{

public static void main(String argv[]){

Abs a = new Abs();

A.amethod();

}

public void myfunc(){

System.out.println("My Func");

}

public void amethod(){

myfunc();

}

}

A.输出结果为 My Func

B.编译指示 Base 类中无抽象方法

C.编译通过,但运行时指示Base 类中无抽象方法

D.编译指示Base 类中的myfunc方法无方法体,没谁会喜欢该方法。

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改