下列选项中,能够正确定义一个函数的是()
A: a():
print("function")
B: DEF a():
print("function")
C: def a():
print("function")
D: def a:
print("function")
A: a():
print("function")
B: DEF a():
print("function")
C: def a():
print("function")
D: def a:
print("function")
举一反三
- 下面哪个不符合Python规定的函数定义( )。 A: def function(a=1, b): B: def function(a, b): C: def function(a=1, b=1): D: def function(a, b=1):
- 下列关于Python中函数定义的代码正确的是?() A: def say_hello: print(Hello) B: def say_helloprint(Hello) C: def say_hello: print(Hello) D: def say_hello:print(Hello)
- 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
- 下列Python代码,函数的定义和调用书写正确的是() A: def test(a| b): print(a) print(b) test(1| 2) B: def test(a): print(a) print(b) test(1, 2) C: def test(a, b): print(a) print(b) test(1) D: def test(a, b): print(a) print(b) test(1, 2)
- 以下代码中哪个是定义函数的语句是正确的? A: def someFunction(): B: function someFunction() C: def someFunction() D: function someFunction():