网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

9、下列代码的运行结果为() def test_scope(): variable=100 print(variable,end=',') def func(): print(variable,end=',') func() varialbe=300 test_scope() print(varialbe)

A.100,300,300

B.100,100,100

C.100,100,300

D.抛出异常


参考答案和解析
'zhang'28
更多 “9、下列代码的运行结果为() def test_scope(): variable=100 print(variable,end=',') def func(): print(variable,end=',') func() varialbe=300 test_scope() print(varialbe)A.100,300,300B.100,100,100C.100,100,300D.抛出异常” 相关考题
考题 执行下列程序后,鼠标单击窗体,输出结果为 。Private Sub Form_Click()Print "Click";End SubPrivate Sub Form_MouseDown(Button As Integer, Shift _As Integer, X As Single, Y As Single)Print "Donw"End SubPrivate Sub Form_MouseUp(Button As Integer, Shift _As Integer, X As Single, Y As Single)Print " Up"End Sub( )。A.DownUpClickB.ClickDownUpC.DownClickUpD.UpDownClick

考题 下列程序段的执行结果为a=2b=0Select Case aCase 1Select Case bCase 0Print "**0**"Case 1Print "**1**"End SelectCase 2Print "**2**"End Select( )。A.**0**B.**1**C.**2**D.0

考题 下列程和序段的执行结果为x=Int(Rnd() + 9)Select Case xCase 10Print "excellent"Case 9Print "good"Case 8Print "pass"Case ElsePrint "fail"End Select( )。A.excellentB.goodC.passD.fail

考题 在窗体上画一个命令按钮,其名称为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

考题 下列块结构条件语句,正确的是( )。A.If x>10 Then print"a" Else if x>5 Then print"b" Else if x<5 Then print"c" End ifB.if x>10 Then print"a" Else if x>5 Print"b" Else Print"c" End ifC.If x>10 Then print"a" Else if x>5 Then print"b" Else x<5 Then Print"c" End ifD.If x>10 Then Print"a" Else if x>5 Then print"b: Else Print"c" End if

考题 以下用户自定义函数 Function Func(a As Integer,b As Integer)As Integer Static m As Integer.i As Integer m=0:i=2 i=i+m+i m=i+a-i-b Func=m End Function 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim k As Integer,m As Integer,p As Integer k=4:m=1 P=Func(k,m) Print P End Sub 程序运行后,单击命令按钮,输出结果为A.8B.9C.10D.11

考题 (27)下列函数过程 Function Func(a As Integer,b As Integer)As Integer Static m As Integer,i As Integer M=0 i=2 A=i+m+1 b=i+a+b Func2=m End Function Private Sub Command1_Click() Dim p As Integer,k As Integer,m As Integer k=4 m=1 P=Func2(k,m) Print k;m End Sub程序运行后,单击命令按钮,输出结果是 A.3 6CR3 6 B.3 6CR3 11C.3 11CR3 6 D.3 11CR3 11

考题 下列程序输出的结果为【 】。Private Sub Commandl_Click( )Dim a As Booleana = TrueIf a Then GoTo 11 Else GoTo 2211:Print "VB";22:Print "VC"End Sub

考题 下面的程序的运行结果是__________func main() {x := 1{ x := 2 fmt.Print(x)}fmt.Println(x)}

考题 下面的程序的运行结果是__________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

考题 下列程和序段的执行结果为 x=Int(Rnd()+9) Select Case X Case 10 Print "excellent" Case 9 Print "good" Case 8 Print "pass" Case Else Print "fail" End SelectA.excellentB.goodC.passD.fail

考题 下列程序段的执行结果为 a=2 b=0 Select Case a Case 1 Select Case b Case 0 Print " * * 0 * *" Case 1 Print" * * 1 * *" End selec Case 2 Print " * * 2 * *" End SelectA.* * 0 * *B.* * 1 * *C.* * 2 * *D.0

考题 已知x代表某个百分制成绩,下列程序段用于显示对应的五级制成绩,正确的是( )A.If x>=60 Then Print"及格" Else If x>=70 Then Print"中" Else If x>=80 Then Print"良" Else If x>=90 Then Print"优" Else Print"不及格" End IfB.If x<90 Then Print"良" Else If x<80 Then Print"中" Else If x<70 Then Print"及格" Else If x<60 Then Print"不及格" Else Print"优" End IfC.If x>=90 then Print"优" Else If x>=80 Then Print"良" Else If x>=70 Then Print"中" Else If x>=60 Then Print"及格" Else Print"不及格" End If End SelectD.Select Case x Case x>=90 Print"优" Case x>=80 Print"良" Case x>=70 Print"中" Case x>=60 Print"及格" Case Else Print"不及格"

考题 假定有如下的Sub过程: Sub Func(x As Single, y As Single) t=x x=t/y y=t Mod y End Sub 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim a As Single Dim b As Single a=6 b=5 Func(a, B) Print a, b End Sub 程序运行后,单击命令按钮,输出结果为 ______。A.6 5B.1 1C.1.2 5D.1.2 1

考题 阅读下列程序: Dim SW As Boolean Function func(X As Integer)As Integer If X<20 Then Y=X Else Y=20+X End If func=Y End Function Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single, Y As Single) SW=False End Sub Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single, Y As Single) SW=True End Sub Private Sub Command1_Click() Dim intNum As Integer intNum=InputBox(" ") If SW Then Print func(intNum) End If End Sub 程序运行后,单击一次窗体,再单击命令按钮,将显示一个输入对话框,如果在对话框中输入20,则程序的输出结果为A.0B.20C.40D.无任何输出

考题 下列程序段的执行结果为 m=1 n=1 Select Case m Case 1 Select Case n Case 0 print"A" Case 1 Print"B" End Select Case 2 Print"C" End SelectA.AB.BC.CD.0

考题 下列程序段的执行结果为m=1n=1Select Case mCase 1Select Case nCase 0print "A"Case 1Print "B"End SelectCase 2Print "C"End SelectA.AB.BC.CD.0

考题 下列程序段的执行结果为 m=1 n=1 Select Case m Case 1 Select Case n Case 0 Print" * * 0 * *" Case 1 Print" * *1* *" End Select Case 2 Print" * * 2 * *" End SelectA.**0**B.**1**C.**2**D.0

考题 有如下的函数过程: Function Func2(a As Integer, b As Integer)'As Integer Static m As Integer, i As Integer m=0 i=2 a=i+m+1 b=i+a+b Func2=m End Function 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim p As Integer, k As Integer, m As Integer k=4 m=1 p=Fune2(k, m) Print k; m p = Func2(k, m) Print k; m End Sub 程序运行后,单击命令按钮,输出结果为( )。A.3 6<CR>3 6B.3 6<CR>3 11C.3 11<CR>3 6D.3 11<CR>3 11

考题 下列程序段,运行后输出的内容是 a=2 c=1 c=c+a If c<10 Then Print c Else Print a End IfA.3B.7C.9D.6

考题 若有如下的函数过程: Function Func2(a As Integer, b As Integer)As Integer Static m As Integer, i As Integer m=0 i=2 a=i+m+1 b=i+a+b Func2 = m End Function 在窗体上画一个命令按钮,然后编写如下事件过程: Private Sub Command1_Click() Dim p As Integer, k As Integer, m As Integer k=4 m=1 p = Func2(k, m) Print k; m p = Func2(k, m) Print k; m End Sub 程序运行后,单击命令按钮,输出结果为( )。A.3 6<CR>3 6B.3 6<CR>3 11C.3 11<CR>3 6D.3 11<CR>3 11

考题 阅读下面的程序; 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

考题 下列程序段的执行结果为______。 Private Sub Command1_Click() a=1:b=1 Select Case a Case 1 Select Case b Case 0 Print "你好!" Case 1 Print "Hello!" End Select Case 2 Print"谢谢使用!" End Select End SubA.你好!B.谢谢使用!C.Hello!D.你好!谢谢使用!

考题 单击命令按钮时,下列程序代码的执行结果为 Private Sub Command1_Click( ) Print MyFunc(24,18) End Sub Public Function MyFunc(m As Integer,n As Integer)As Integer Do While m ◇ n Do While mn:m=m—n:Loop DO While m<n:n=n-m:Loop Loop My Func=m End FunctionA.2B.4C.6D.8

考题 下面程序的运行结果为( )。a=10def setNumber(): a=100setNumber()print(a) A.10B.100C.10100D.10010

考题 代码for i in range(3):print(i,end=’,’)的执行结果为()。

考题 填空题代码for i in range(3):print(i,end=’,’)的执行结果为()。