下列程序段执行后,输出结果是: number = 20 try: if number < 0: number = -number print(number,end=) except: print("有异常发生",end=) else: print("平安无事",end=) finally: print("我很好我可以的",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 = 4 while number >; 0: for i in range(number): print(i, end='') number -= 1 A: 0123012010 B: 012301201 C: 01230120 D: 0123012
- 以下程序的输出结果是___________。 number = 10 if number % 2 == 0: print(number, 'is even') elif number % 5 == 0: print(number, 'is multiple of 2')
- 阅读下面的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=’’)
- 中国大学MOOC: 以下程序的输出结果是?number = 30if number % 2 == 0: print(number, is even)elif number % 3 == 0: print(number, is multiple of 3)