网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
请改正下面程序中存在的错误。 def deco(func): def inner(): print('deco begin') func() print('deco end') return inner @deco def add(a,b): print(a+b) if __name__=='__main__': add(3,5)
参考答案和解析
D
更多 “请改正下面程序中存在的错误。 def deco(func): def inner(): print('deco begin') func() print('deco end') return inner @deco def add(a,b): print(a+b) if __name__=='__main__': add(3,5)” 相关考题
考题
在窗体上画一个命令按钮,其名称为Command1,然后编写如下程序: Function Func(ByVal x As Integer, y As Integer) y=x*y If y > 0 Then Func = x Else Func = y End If End Function Private Sub Command1_Click( ) Dim a As Integer, b As Integer a=3 b=4 c=Func(a,B)Print "a=";a Print "b=";b Print "c=";c End Sub 程序运行后,单击命令按钮,其输出结果为: ______。A.a=3 b=12 c=3B.a=3 b=4 c=3C.a=3 b=4 c=12D.a=13 b=12 c=12
考题
下面的程序的运行结果是__________type Slice []intfunc NewSlice() Slice {return make(Slice, 0)}func (s* Slice) Add(elem int) *Slice {*s = append(*s, elem)fmt.Print(elem)return s}func main() { s := NewSlice()defer s.Add(1).Add(2)s.Add(3)}
考题
下面的程序的运行结果是__________func main() { x := []string{"a", "b", "c"}for _, v := range x { fmt.Print(v)}}
考题
阅读下列程序: Function func(n As Integer)As Integer Sum = 0 For i = 1 To n Sum = Sum + (i + 1)* i Next i func = Sum End Function.Private Sub Command1_Click () Dim a As Integer a= 5 s = func (A)Print s End Sub 程序运行后,单击命令按钮,输出的结果为A.80B.60C.70D.15
考题
classBirds{publicstaticvoidmain(String[]args){try{thrownewException();}catch(Exceptione){try{thrownewException();}catch(Exceptione2){System.out.print(inner);}System.out.print(middle);}System.out.print(outer);}}结果为:()A.innerB.innerouterC.middleouterD.innermiddleouter
考题
有如下程序: include using namespace std; class TestClass { private: int x,y; pu
有如下程序: #include<iostream> using namespace std; class TestClass { private: int x,y; public: TestClass (int i,int j) { x=i; y=j; } void print() { cout<<"print1"<<end1; } void print()const { cout<<"print2"<<end1; } }; int main() { const TestClass a(1,2); a.print(); return 0; } 该程序运行后的输出结果是( )。A.print1B.print2C.print1 print2D.程序编译时出错
考题
阅读下面的程序; Function Func(x As Integer,y As Integer)As Integer Dim n As Integer Do While n < = 4 x=x + y n = n + 1 Loop Func=x End Function Private Sub Command1_Click() Dim x As Integet, y As Integer Dim n As Integer,z As Integer x=1 y=1 For n = 1 To 6 z=Func(x,y) Next n Print z End Sub 程序运行后,单击命令按钮,输出的结果为.A.16B.21C.26D.31
考题
下面程序的运行结果为( )。def swap(list): temp=list[0] list[0]=list[1] list[1]=templist=[1,2]swap(list)print(list)
A.[1,2]B.[2,1]C.[2,2]D.[1,1]
考题
现有: class Birds { public static void main (String [] args) { try { throw new Exception () ; } catch (Exception e) { try { throw new Exception () ; } catch (Exception e2) { System.out.print ("inner "); } System. out.print ( "middle" ) ; } System.out.print ("outer") ; } } 结果是()A、 inner outerB、 middle outerC、 inner middle outerD、.编译失败
考题
class Birds { public static void main(String [] args) { try { throw new Exception(); } catch (Exception e) { try { throw new Exception(); } catch (Exception e2) { System.out.print("inner "); } System.out.print("middle "); } System.out.print("outer "); } } 结果为:() A、innerB、inner outerC、middle outerD、inner middle outer
考题
单选题现有: class Birds { public static void main (String [] args) { try { throw new Exception () ; } catch (Exception e) { try { throw new Exception () ; } catch (Exception e2) { System.out.print ("inner "); } System. out.print ( "middle" ) ; } System.out.print ("outer") ; } } 结果是()A
inner outerB
middle outerC
inner middle outerD
.编译失败
考题
在Oracle 中,下列语句中哪些可以合法地创建一个函数? (1.0分) [多选]
A. CREATE FUNCTION func_name(cdcode NUMBER) RETURN CHAR IS DECLARE dis_cd CHAR(15);
BEGIN .. END; B. CREATE FUNCTION func_name(cdcode NUMBER) RETURN CHAR IS dis_cd CHAR(15);
BEGIN .. END; C. CREATE FUNCTION func_name(cdcode NUMBER) IS
BEGIN .. END; D. CREATE FUNCTION func_name(cdcode NUMBER) RETURN CHAR IS
BEGIN .. END; E. CREATE FUNCTION func_name(cdcode NUMBER) RETURN CHAR IS DECLARE dis_cd STRING (15);
BEGIN .. END;
热门标签
最新试卷