下列代码的输出是( )。 >>> def greetPerson(*name): print('Hello', name) [br][/br] >>> greetPerson('Frodo', 'Sauron')
A: Hello Frodo Hello Sauron
B: Hello ('Frodo', 'Sauron')
C: Hello Frodo
D: Syntax Error! greetPerson() can take only one argument.
A: Hello Frodo Hello Sauron
B: Hello ('Frodo', 'Sauron')
C: Hello Frodo
D: Syntax Error! greetPerson() can take only one argument.
举一反三
- 下列关于Python中函数定义的代码正确的是?() A: def say_hello: print(Hello) B: def say_helloprint(Hello) C: def say_hello: print(Hello) D: def say_hello:print(Hello)
- 定义类如下:class Hello(): def __init__(self,name): self.name=name def showInfo(self): print(self.name)下面代码能正常执行的 ( )。 A: h = Helloh.showInfo() B: h = Hello()h.showInfo('张三') C: h = Hello('张三')h.showInfo() D: h = Hello('admin')h.showInfo
- 语句print("hello<br/>world ")输出的是:(<br/>) A: ("hello<br/>world ") B: "hello<br/>world " C: hello<br/>world D: 运行结果出错
- print(print('Hello')),输出为( )。 A: Hello None B: Hello C: None D: Hello None
- 以下关于Python3.0版本语法正确的有() A: print("hello,world"); B: print("hello,world") C: printf("hello,world"); D: print("{}.format(name)")