下列说法不正确的是( )。知识点:全局变量 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
下列程序的输出结果是________。 def f(a, b) : return a + b def main() : a = 5 b = 6 print(f(a, b)) main()
下列程序的输出结果是________。 def f(a, b) : return a + b def main() : a = 5 b = 6 print(f(a, b)) main()
给出下面代码的运行结果: def fun_1(x, y=3): x = x * 10 + y return fun_2(x) def fun_2(x): return x / 5 fun_1(6, 5)
给出下面代码的运行结果: def fun_1(x, y=3): x = x * 10 + y return fun_2(x) def fun_2(x): return x / 5 fun_1(6, 5)
def Sum(*p): return sum(p) print(Sum(3, 5, 8)) 运行结果是( )
def Sum(*p): return sum(p) print(Sum(3, 5, 8)) 运行结果是( )
def Sum(a, b=3, c=5): print(a,b,c) Sum(8) 运行结果是:
def Sum(a, b=3, c=5): print(a,b,c) Sum(8) 运行结果是:
What will be the output of the following Python code? [br][/br]print("abc DEF".capitalize()) A: abc def B: ABC DEF C: Abc def D: Abc Def
What will be the output of the following Python code? [br][/br]print("abc DEF".capitalize()) A: abc def B: ABC DEF C: Abc def D: Abc Def
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))
函数定义格式正确的是() A: def f(n) B: def f(n): C: def (n): D: def fn:
函数定义格式正确的是() A: def f(n) B: def f(n): C: def (n): D: def fn:
写出下面代码的运行结果( )def f(a,b=5,c=7...end=’ ’)print(f(10))
写出下面代码的运行结果( )def f(a,b=5,c=7...end=’ ’)print(f(10))
下列语句中,正确的是? def f(a,b,*):;;|def f(a=0,b):|def f(a,b==0):;|def f(a,*b):
下列语句中,正确的是? def f(a,b,*):;;|def f(a=0,b):|def f(a,b==0):;|def f(a,*b):