有如下程序,运行后的输出结果是 ______。 a = 5 If a <= 3 Then Print 3; End If If a <= 4 Then Print 4; End If If a <= 5 Then Print 5; End If If a <= 6; Print 6; End If
A: 3456
B: 456
C: 56
D: 6
A: 3456
B: 456
C: 56
D: 6
举一反三
- 运行以下程序输出的结果是:( )。for i in range(6):if i%2==0:continueelif i%3:print(i,end=' ')else: print('end') A: 1 B: 1 end C: 1 5 end D: 1 5
- 以下程序的运行结果为:a=15if a>15: print(5,end="")if a>10: print(20,end="")if a>5: print(35,end="")
- 下列说法不正确的是( )。知识点:全局变量 A: x = 5def fun(): x = 2 x = x * 3 print(x, end=' ')fun()print(x)程序无误,输出结果为6 5 B: x = 5def fun(): global x x = 2 x = x*3 print(x, end=' ')fun()print(x)程序无误,输出结果为6 6 C: x = 5def fun(): x = x * 3 print(x ,end=' ')fun()print(x)程序无误,输出的结果为15 15 D: x = 5def fun(): print(x, end=' ')fun()print(x)程序无误,输出的结果为5 5
- 运行如下程序,输出结果是 。 try: x, y = 1, 0 z = x / y print(0, end=",") except: print("1", end=",") else: print("2", end=",") finally: print("3", end=",")
- 下列程序的执行结果是( ).for i in range(2): print(i,end=' ' )for I in range(4,6): print(I,end=' ' ) A: 2 4 6 B: 0 1 2 4 5 6 C: 0 1 0 1 2 3 D: 0 1 4 5