以下代码执行结果是【】。size = 100def draw_pentagram(size):print(size, 'size')size += 10draw_pentagram(size) A: size 110 B: 100 size C: size 100 D: 110 size
以下代码执行结果是【】。size = 100def draw_pentagram(size):print(size, 'size')size += 10draw_pentagram(size) A: size 110 B: 100 size C: size 100 D: 110 size
以下哪个程序段是使用递归函数实现1到100求和 A: def product1(num): product=1 for i in range(1,num+1): product=product *i return productprint(product1(10)) B: def sum1(num): sum2=0 for i in range(1,num+1): sum2+=i return sum2 print(sum1(100)) C: def product2(num): if num==1: return 1 else: return num *product2(num-1)print(product2(10)) D: def sum_a(num1): if num1==1: return 1 else: return num1+sum_a(num1-1) print(sum_a(100))
以下哪个程序段是使用递归函数实现1到100求和 A: def product1(num): product=1 for i in range(1,num+1): product=product *i return productprint(product1(10)) B: def sum1(num): sum2=0 for i in range(1,num+1): sum2+=i return sum2 print(sum1(100)) C: def product2(num): if num==1: return 1 else: return num *product2(num-1)print(product2(10)) D: def sum_a(num1): if num1==1: return 1 else: return num1+sum_a(num1-1) print(sum_a(100))
一下程序输出的结果的是() g=100 def<br/>temp(x): x=50 print(temp(g)) print(g) A: None 50 B: 100 50 C: 50 100 D: None 100
一下程序输出的结果的是() g=100 def<br/>temp(x): x=50 print(temp(g)) print(g) A: None 50 B: 100 50 C: 50 100 D: None 100
设有函数定义: def fun(a = 0): print(a * 100) 则以下错误的函数调用语句是________。
设有函数定义: def fun(a = 0): print(a * 100) 则以下错误的函数调用语句是________。
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 myfun(x,y=200,z=100): print(x,y,z) myfun(50,100)
如下程序的输出结果是___________def myfun(x,y=200,z=100): print(x,y,z) myfun(50,100)
函数定义格式正确的是() 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,*):;;|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):
阅读下面的程序 def func(); print(x) x=100 func() 执行上述语句后,输出的结果为()
阅读下面的程序 def func(); print(x) x=100 func() 执行上述语句后,输出的结果为()
下列程序的运行结果为( )。class Account: def __init__(self,id): self.id=id id=888acc=Account(100)print(acc.id) A: 888 B: 788 C: 100 D: 出错
下列程序的运行结果为( )。class Account: def __init__(self,id): self.id=id id=888acc=Account(100)print(acc.id) A: 888 B: 788 C: 100 D: 出错