• 2021-04-14 问题

    如下代码可以实现当输入6的时候输出x>5,输入4的时候输出 3<x<=5,输入1的时候输出x<=3 x = int(input()) if x>5: print("x>5") elif x>3: print("3<x<=5") print("x<=3")

    如下代码可以实现当输入6的时候输出x>5,输入4的时候输出 3<x<=5,输入1的时候输出x<=3 x = int(input()) if x>5: print("x>5") elif x>3: print("3<x<=5") print("x<=3")

  • 2022-06-06 问题

    下列说法不正确的是( )。知识点:全局变量 A: x = 5def fun(): x = 2 x = x * 3 print(x, end=' ')fun()print(x)程序无误,输出结果为6 5 B: x = 5def fun(): global x x = 2 x = x*3 print(x, end=' ')fun()print(x)程序无误,输出结果为6 6 C: x = 5def fun(): x = x * 3 print(x ,end=' ')fun()print(x)程序无误,输出的结果为15 15 D: x = 5def fun(): print(x, end=' ')fun()print(x)程序无误,输出的结果为5 5

    下列说法不正确的是( )。知识点:全局变量 A: x = 5def fun(): x = 2 x = x * 3 print(x, end=' ')fun()print(x)程序无误,输出结果为6 5 B: x = 5def fun(): global x x = 2 x = x*3 print(x, end=' ')fun()print(x)程序无误,输出结果为6 6 C: x = 5def fun(): x = x * 3 print(x ,end=' ')fun()print(x)程序无误,输出的结果为15 15 D: x = 5def fun(): print(x, end=' ')fun()print(x)程序无误,输出的结果为5 5

  • 2022-06-09 问题

    def f(x,n = 2): return(x**n)print(f(5))print(f(3,3))

    def f(x,n = 2): return(x**n)print(f(5))print(f(3,3))

  • 2021-04-14 问题

    下列程序段的运行结果为( )。 Dim x x = Int(Rnd) + 5 Select Case x Case 5 Print "优秀" Case 4 Print "良好" Case 3 Print "及格" Case Else Print "不及格" End Select

    下列程序段的运行结果为( )。 Dim x x = Int(Rnd) + 5 Select Case x Case 5 Print "优秀" Case 4 Print "良好" Case 3 Print "及格" Case Else Print "不及格" End Select

  • 2021-04-14 问题

    if x > 10: print("x=", x) elif x > 0: print("x=", 2 * x) elif x >- 2: print("x=" ,x + 5) else: print("x=", -x) 当输入的x的值为 10 和 -2 的时候,代码输出的结果分别为( ):

    if x > 10: print("x=", x) elif x > 0: print("x=", 2 * x) elif x >- 2: print("x=" ,x + 5) else: print("x=", -x) 当输入的x的值为 10 和 -2 的时候,代码输出的结果分别为( ):

  • 2021-04-14 问题

    【单选题】2.以下 if 语句语法正确的是()。 A. if(x>0) print(x) Else print(-x) B. If x>0 print(x) else print(-x) C. if x>0: Print(x) Else print(-x) D. if x>0: Print(x) else:print(-x) A. if(x>0)     print(x) Else       print(-x) B. if x>0: Print(x) Else       print(-x) D. B. If x>0 print(x) else       print(-x) C. if x>0: Print(x) Else       print(-x) D. if x>0: Print(x) else:print(-x)

    【单选题】2.以下 if 语句语法正确的是()。 A. if(x>0) print(x) Else print(-x) B. If x>0 print(x) else print(-x) C. if x>0: Print(x) Else print(-x) D. if x>0: Print(x) else:print(-x) A. if(x>0)     print(x) Else       print(-x) B. if x>0: Print(x) Else       print(-x) D. B. If x>0 print(x) else       print(-x) C. if x>0: Print(x) Else       print(-x) D. if x>0: Print(x) else:print(-x)

  • 2022-06-08 问题

    如下Python语句的输出是______ x<br/>= 5; y = 5; print(x is y)

    如下Python语句的输出是______ x<br/>= 5; y = 5; print(x is y)

  • 2022-06-01 问题

    x=(3 for i in range(5)) print(list(x)) 结果是 A: [3,3,3,3,3] B: []

    x=(3 for i in range(5)) print(list(x)) 结果是 A: [3,3,3,3,3] B: []

  • 2022-06-07 问题

    Which of the following does not print the same sequence of numbers as the others?下列哪一个不打印与其他数字相同的数字序列? A: X = 5while (X &lt; 6): print(X) X = X + 1 B: X = 4while (X &lt; 5): X = X + 1 print(X) C: X = 5repeat: print( X) X = X + 1 until (X &gt; 6)

    Which of the following does not print the same sequence of numbers as the others?下列哪一个不打印与其他数字相同的数字序列? A: X = 5while (X &lt; 6): print(X) X = X + 1 B: X = 4while (X &lt; 5): X = X + 1 print(X) C: X = 5repeat: print( X) X = X + 1 until (X &gt; 6)

  • 2021-04-14 问题

    【单选题】2.以下 if 语句语法正确的是( )。 A. if(x>0) print(x) Else print(-x) B. If x>0 print(x) else print(-x) C. if x>0: Print(x) Else print(-x) D. if x>0: Print(x) else:print(-x) A. if(x>0)   

    【单选题】2.以下 if 语句语法正确的是( )。 A. if(x>0) print(x) Else print(-x) B. If x>0 print(x) else print(-x) C. if x>0: Print(x) Else print(-x) D. if x>0: Print(x) else:print(-x) A. if(x>0)   

  • 1 2 3 4 5 6 7 8 9 10