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)
举一反三
- #print("Test")print("abc") #print("xyz")程序输出 A: Test<br/>abc xyz B: Test <br/>abc <br/>xyz C: abc D: abc xyz
- #print(“Test”)[br][/br]print(“abc”)#print(“xyz”)程序的输出结果是() A: Test <br>abcxyz B: abc C: abcxyz D: Test abc <br>xyz
- print(test())
- #print("Test") print("abc") #print("xyz") 程序输出
- 定义类如下:class Test():def __init__(self,name):self.name=namedef show(self):print(self.name)下面代码能正常执行的是 ( ) A: t = Test('张三')t.show() B: t = Test()t.show('张三') C: t = Test()t.show() D: t = Testt.show('张三')
内容
- 0
已知函数定义:def Test(*p): print(p)调用该函数Test(3, 5, 8),下面输出正确的是: A: (3, 5, 8) B: [3, 5, 8] C: 3, 5, 8 D: 3
- 1
阅读下面的程序:[br][/br]class Test:[br][/br]data1 = 10[br][/br]def __str__(self): return "data1 = %d" % (self.data1)[br][/br]test = Test()[br][/br]print(test)[br][/br]print(repr(test))[br][/br]上述程序最终执行的结果为()。 A: 面向对象.Test object at 0x101ca12e8>data1 = 10 B: 面向对象.Test object at 0x101ca12e8><面向对象.Test object at 0x101ca12e8 C: data1 = 10data1 = 10 D: data1 = 10
- 2
以下程序的输出结果,可能的选项是______。 import random def test(): x = random.randint(0,10) y = random.randint(10,20) return([x,y]) print(test())
- 3
Define a function as below with f as the function parameter,def test(f, a, b): print(f(a, b))Which of the following options will be the result of test((lambda x,y: x ** 3 + y), 2, 3)? A: 8 B: 9 C: 10 D: 11
- 4
下列关于Python中函数定义的代码正确的是?() A: def say_hello: print(Hello) B: def say_helloprint(Hello) C: def say_hello: print(Hello) D: def say_hello:print(Hello)