以下程序的输出结果是___________。 number = 10 if number % 2 == 0: print(number, 'is even') elif number % 5 == 0: print(number, 'is multiple of 2')
举一反三
- 中国大学MOOC: 以下程序的输出结果是?number = 30if number % 2 == 0: print(number, is even)elif number % 3 == 0: print(number, is multiple of 3)
- 如果输入4,6.8,1,9.7,-2,则下列程序的输出结果是() number=eval(input()) max=number whilenumber>0: number=eval(input()) ifnumber>max: max=number print(max)
- 下列程序段执行后,输出结果是: number = 20 try: if number < 0: number = -number print(number,end=) except: print("有异常发生",end=) else: print("平安无事",end=) finally: print("我很好我可以的",end=)
- 对一个列表里的数据进行奇偶数分离 numbers = [12, 37, 5, 42, 8, 3] even = [] odd = [] while len(numbers) > 0 : number = ( ) if(number % 2 == 0): even.append(number) else: odd.append(number) print even print odd
- 下列语句的执行结果是: number = 10 def myPrint(): global number number = 1 myPrint() print(number) A: 10 B: 1 C: 0 D: 报错