• 2022-05-31
    判断以下的代码段是否合法 >>>number = 5>>>print(number + "is my lucky number.")
  • 内容

    • 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