阅读下面的python程序,请问输出结果是什么?
Print(“T”,end=’’) if not 0 else print (‘F’,end=’’)
Print(“T”,end=’’)if 6 else print (‘F’,end=’’)
Print(“T”,end=’’)if””else print(‘F‘,end=’’)
Print(“T”,end=’’)if”abc”else print(‘F’,end=’’)
Print(“T”,end=’’)if____else print (‘F’,end=’’)
Print(“T”,end=’’)if(1,2)else print(‘F’,end=’’)
Print(“T”,end=’’)if[ ]else print(‘F’,end=’’)
Print(“T”,end=’’)if[1,2]else print(‘F’,end=’’)
Print(“T”,end=’’)if{ }else print(‘F’,end=’’)
Print(“T”,end=’’)if{1,2}else print(‘F’,end=’’)
Print(“T”,end=’’) if not 0 else print (‘F’,end=’’)
Print(“T”,end=’’)if 6 else print (‘F’,end=’’)
Print(“T”,end=’’)if””else print(‘F‘,end=’’)
Print(“T”,end=’’)if”abc”else print(‘F’,end=’’)
Print(“T”,end=’’)if____else print (‘F’,end=’’)
Print(“T”,end=’’)if(1,2)else print(‘F’,end=’’)
Print(“T”,end=’’)if[ ]else print(‘F’,end=’’)
Print(“T”,end=’’)if[1,2]else print(‘F’,end=’’)
Print(“T”,end=’’)if{ }else print(‘F’,end=’’)
Print(“T”,end=’’)if{1,2}else print(‘F’,end=’’)
举一反三
- 运行如下程序,输出结果是 。 try: x, y = 1, 0 z = x / y print(0, end=",") except: print("1", end=",") else: print("2", end=",") finally: print("3", end=",")
- 下列程序段执行后,输出结果是: number = 20 try: if number < 0: number = -number print(number,end=) except: print("有异常发生",end=) else: print("平安无事",end=) finally: print("我很好我可以的",end=)
- 下面程序的输出结果是( )。 n = 1 while n < 6: if n == 3: print(" ",end=' ') else: print(n,end=' ') n = n + 1
- 在窗体中添加一个命令按钮Command1,编写如下代码: Private Sub Command1_Click() x = 6 If x > 6 Then If x = 6 Then Print "a" Else Print "b" End If Else If x < 8 Then Print "c" Else If x = 6 Then Print "d" End If End If End If End Sub 运行后,单击命令按钮,则在窗体上显示的是( )。
- 运行以下程序输出的结果是:( )。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