更多“10、运行以下程序,输出结果为: lst1=['abc','def','ghi'] lst2=[i[::-1] for i in lst1] print(lst2[1][2])”相关的问题
第1题
以下内容在同一个源程序中: class A { int a; A(int a) { this.a=a; } int add() { return a+10; } } class TestA { public static void f(A t) { System.out.println(t.add()); } public static void main(String[] args) { f(new A() { int add() { return a+20; } } ); } } 则()。
A.程序的运行结果为输出0
B.程序的运行结果为输出10
C.程序的运行结果为输出20
D.程序不能编译通过
点击查看答案
第2题
设有以下程序 main() { int n1,n2; scanf("%d",&n2); while (n2!=0) { n1=n2%10; n2=n2/10; printf("%d",n1); } } 程序运行后,如果从键盘上输入1298,则输出结果为()。
点击查看答案
第3题
有以下程序段: m=5 sum=0 while m<10: sum=sum+m m=m+1 print(sum) 程序运行后输出的结果为: ()
点击查看答案
第4题
若程序只有以下两行代码,则程序的执行结果为___________。 x = a + 10 print(x)
点击查看答案
第5题
运行以下程序,输出结果为: lst=[1,2,3,4,5] for i in lst: i*=2 print(lst[3])
点击查看答案
第6题
若程序只有以下两行代码,则程序的执行结果为___________。 x = a + 10 print(x)
点击查看答案
第7题
若程序只有以下两行代码,则程序的执行结果为___________。 x = a + 10 print(x)
点击查看答案
第8题
关于以下程序的正确说法是哪一项? def f(x): a = 7 print(a + x) a = 5 f(3) print(a)
A.程序的运行结果为10和7。
B.程序的运行结果为10和5。
C.程序的运行结果为8和5。
D.程序不能正常执行。
点击查看答案
第9题
运行以下程序,输出结果为: lst1=[1,2,3,4,5] lst2=[] for i in lst1: lst2.append(i) print(lst2[-1])
点击查看答案