举一反三
- 以下程序的输出结果是___________。 number = 10 if number % 2 == 0: print(number, 'is even') elif number % 5 == 0: print(number, 'is multiple of 2')
- 下列程序段执行后,输出结果是: number = 20 try: if number < 0: number = -number print(number,end=) except: print("有异常发生",end=) else: print("平安无事",end=) finally: print("我很好我可以的",end=)
- 中国大学MOOC: 以下程序的输出结果是?number = 30if number % 2 == 0: print(number, is even)elif number % 3 == 0: print(number, is multiple of 3)
- This is my phone number and it's the same as____________(微信)number.
- 对于如下关于随机数的代码 for(int number = 0; number != 5; number = (int)(Math.random() * 10)) { System.out.println(number); } 以下描述正确的是( )(2分)
内容
- 0
以下给数组赋值的语句正确的是() A: int[] number ; number = {1,2,3,4,5}; B: int[] number = {1,2,3,4,5}; C: int[] number = new int[5]; number[5] = 5; D: int[] number = new int[5]; number = 5;
- 1
Which number is considered to be a lucky number when you give a gift in Thailand? A: 6 B: 1 C: 5 D: 3
- 2
以下代码的输出结果是_________? int number = 6; while (number >; 0) { number -= 3; System.out.print(number + " "); } A: 60 B: 63 C: 30 D: 3 0 -3
- 3
如何实现允许用户从键盘输入数据的功能? A: a = input(5) B: a = print(5) C: a = print("please input a number:") D: a = input("please input a number:")
- 4
假设 number 的输入是9。以下程序将显示什么?number = eval(input("Enter an integer: ")) isPrime = True for i in range(2, number): if number % i == 0: isPrime = False print("i is", i) if isPrime: print(number, "is prime") break else: print(number, "is not prime") A: i is 3 9 is prime B: i is 3 9 is not prime C: i is 2 9 is prime D: i is 2 9 is not prime