以下函数调用错误的是:deffun(a,b=200):returna+b
A: print(fun(100))
B: print(fun(100,200))
C: print(fun(b=100,a=200))
D: print(fun())
A: print(fun(100))
B: print(fun(100,200))
C: print(fun(b=100,a=200))
D: print(fun())
举一反三
- 下面那个程序代码是正确的_________ A: print("Programming is fun") print("Python is fun") B: print("Programming is fun")print("Python is fun") C: print("Programming is fun)print("Python is fun") D: print("Programming is fun)print("Python is fun")
- 设有函数定义: def fun(a = 0): print(a * 100) 则以下错误的函数调用语句是________。
- 下列说法不正确的是( )。知识点:全局变量 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: print("Programming is fun") print("Python is fun") B: print("Programming is fun")print("Python is fun") C: print("Programming is fun)print("Python is fun") D: print("Programming is fun)print("Python is fun")
- 下面程序段的输出为a=1def fun(a): a=a+2 print(a) fun(a)print(a) A: 3 1 B: 4 1 C: 11 D: 33